I am new to HTTP and Salesforce's APIs
What is the difference between the salesforce rest resource they talk about in this trailhead module – https://trailhead.salesforce.com/content/learn/modules/api_basics/api_basics_rest
and an HTTP request message? There's also the HttpRequest…. I am not sure how they all fit together
Best Answer
This classifies as a very broad question, but some of these pointers should help.
HTTP, REST, HTTP Messages are all inter-related yet different.
HTTP is a protocol used to communicate between client and server to fetch resources.
HTTP Message is term used for the data exchanged between client and server.
HttpRequest
is one such data which is sent to the server by a client while making a request, and thatHttpResponse
is the other set of data which is sent back to the client from the server.A Salesforce REST Resource is a resource exposed as an API (imagine an Apex class annotated with
@RestResource
) which is exposed to return certain data based on certain request based on the HTTP protocol and utilizing the HTTP Messages (HttpRequest/HttpResponse) as the component for data exchange. You can find more on REST here.