Posts

Showing posts from January, 2023

HTTP METHODS

  HTTP METHODS GET Method: The HTTP GET method is used to read/ retrieve a representation of a resource. In the happy path ( non-error), GET returns a representation in XML or JSON and an HTTP response code of 200 (OK). In an error case, it most often returns a 404 (NOT FOUND) or 400 (BAD REQUEST). POST Method: The POST verb is most-often utilized to create new resources. In other words, when creating a new resource, POST to the parent and the service takes care of associating the new resource with the parent, assigning an ID (new resource URI), etc. On successful creation, return HTTP status 201, returning a Location header with a link to the newly-created resource with the 201 HTTP status.In an error case 404 (Not Found), 409 (Conflict) if resource already exists. PUT Method: PUT is most-often utilized for update capabilities, PUT-ing to a known resource URI with the request body containing the newly-updated representation of the original resource. On successful update, return 20...

Endpoints vs Resources

Endpoints vs Resources Difference between Endpoints & resources: Resource is a  subset of Endpoint. An endpoint by itself is the location where a service can be accessed. The term endpoint is focused on the URL that is used to make a request. The term resource is focused on the data set that is returned by a request. The terms resource and endpoint are often used synonymously. But in fact they do not mean the same thing. Resources: Architecturally, resources are data sets that an API allows you to work with, and which are accessible via endpoints. They have relationships with other resources as well as a set of operations that you can carry out on them. Endpoints Endpoints are URIs that introduce the location of the resource that you want to do a CRUD operation on. The relation between a resource, an endpoint, and an HTTP method is the following: What → Where → Action Examples: Resources :   /gmail/about/#  ( Base URL:  https://www.google.com ) Endpoin...

#api #endpoint #resources #https API TERMINOLOGY Part 6

Image