A good place to start would be to look at the documentation on HttpRequest.
Most everything should map fairly intuitively from cURL.
PUT, etc... are Http methods, so use
- you'd pass
- each individual header is set by using
setHeader(String key, String value), e.g.
request.setHeader('Authorization', 'Bearer <token string here>')
- POST data is sent in the body of the request, so
setBody(String) is what you'd use
The actual request is sent by using the
send() method of the
Http class (documentation here)
About the only other gotcha that I can think of is that you can't examine the network request (because it is sent from one of Salesforce's servers), so it's a very good idea to store the
HttpResponse result you get from
Http.send(HttpRequest request) in a separate variable, and have logic to inspect the status code via
If you don't check the response code/message, you won't have any way of determining if your callout worked, or what went wrong (if it didn't work).