Friday, 1 March 2024

Query Params

 How to include the query param in the request URL?

  • https://s-letru-sd/rest/cd/?name=test&version=1

Response headers

 CONTENT  TYPE

  • Specifies the MIME type of the data in the response body.

CONTENT LENGTH

  • Specifies the length of the response body in bytes.

CACHE-CONTROL

  • Specifies the caching behaviour of the response.

LOCATION

  • Specifies the URI of a resource that can be used to retrieve the requested resource.

SERVER

  • Specifies the name and version of the server software that generated the response.

ACCESS CONTROL ALLOW ORIGIN

  • Specifies which origins are allowed to access the resource.


Request Methods

 GET

  • Retrieve data from the server

POST

  • Send data to the resource to create a resource

DELETE

  • Delete the resource

PUT

  • Send data to the server to update a resource

PATCH

  • Send data to the server to update resources partially

map online shopping status with REST API

  Example Sequence of API Calls Browse products : GET /products View product details : GET /products/12345 Add product to cart : POST /cart ...