Enlist different types of HTTP requests supported by REST API?

Aditya Bansal
Aditya Bansal

Posted On: Feb 22, 2018

 

REST supports a group of HTTP methods to manipulate the request and response. They are,

GET – It is used to read the representation of a resource. It usually returns the resource in XML or JSON type with the HTTP response code 200 on successful creation.

POST – It is used to create new resources. It is usually used to create a subordinate resource and returns HTTP code 201 on successful creation.

PUT – This method mainly used to update the resource. It can also be used to create a resource when the resource ID is selected by the client. It returns response code 200 on a successful update.

PATCH – It is used to modify the resource. It only contains the change needed to be modified in the resource.

DELETE – It deletes a resource. The resource needed to be deleted is identified by a URI. It returns an HTTP status 200 on successful completion.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Rest API Interview Questions

    Explain What is REST?

    REST, expanded as Representational State Transfer, is an architectural style developed by Roy Fielding in 2000. REST presents a set of constraints to be used in the creation of web services. The servi...

    Rest API Interview Questions

    What is resource in REST API?

    In the REST architecture, every content is a resource. It can be a text file, HTML pages, images, videos, or business data. These resources are identified by the URI or global ID’s which can be ...

    Rest API Interview Questions

    What is options in REST API?

    The options the REST are annotations that are used to indicate whether a method responds to the HTTP OPTIONS request only. It allows the client of the REST API to determine what HTTP methods (GET, HEA...