A very late-to-the-party answer, but one that takes a slightly different approach to the existing answers.
As stated in Bob Buzzard's answer, the Salesforce platform doesn't allow synchronous invocation of a callout here and Salesforce has recommended the use of future methods to take the callout into a separate, asynchronous transaction.
However, there are numerous problems with doing that since:
- Your trigger can be called many times in a single transaction, for a single (bulk) DML operation or if multiple (smaller) DML operations are performed in your transaction.
- There are quite restrictive limits on how many future methods you can invoke in a single transaction.
- You cannot invoke future methods at all in an asynchronous context but your trigger may still be called in such a case.
- There are daily limits on the number of async processes you can run on your org.
The above is not an exhaustive list but captures the most important ones.
An alternative to future methods is to consider the use of Queueables, also mentioned in existing answers. However, these also suffer significant restrictions, especially in asynchronous contexts. They also use asynchronous apex limits.
My suggestion is to actually use record tagging and Platform Events to resolve this issue. Record tagging (marking the record as needing to be processed in some way, such as here performing a callout) is a good way of identifying those records to be processed in a manner that means you don't rely on Platform Events holding this important information - after all, Platform Events don't have guaranteed delivery and you want to make sure that you do your callout even if one or more Platform Events get lost.
Platform Events are a great vehicle for taking you out of the trigger and into a separate transaction because they don't use any asynchronous limits but still allow you to do your callout, initiated from your trigger.
You can also minimize the number of events you publish (there are hourly limits to this) since you only need one to be created and published from your transaction to initiate the processing you need. That processing can be written to fit in as much as is possible (100 callouts, for example) and if there are still more records to process simply publish a follow-up Platform Event. This leads to selective chaining of the processing while it is needed.
More detail on this can be found in this Apex Hours article, which also references an example implementation (this doesn't do callouts, but illustrates how you could).