different http request methods code example

Example 1: http methods

Get : enables you to retrieve data from server
Post: enables you to add data to an existing 
     file or resource in a server
Put: lets you replace an existing file or resource
     in a server
Delete: lets you delete data from server
Patch:For partial update

Example 2: what is http request

HTTP request method is made up of five components:
Request Method ==> Get, Post, Put, Delete (these are
the common ones)
Request URL ==> the URL of the resource
Request Header ==> Accept-Language, AcceptEncoding, User-Agent, Host
Request Body ==> This is the data to be sent to the
resource
Request Query Parameters : key value pair 
		 	
HTTP response method is made up of three components:
Response Status Code ==> 200, 301, 404, 500
(these are the most common ones)
Response Header Fields ==> Date, Server, LastModified, Content-Type
Response Body ==> This is the data that comes
back to the client from the server.

Example 3: options http method

The OPTIONS Method lists down all the 
operations of a web service supports. 
It creates read-only requests to the server.

Example 4: http request and http response

HTTP request method is made up of four components:
Request Method ==> Get, Post, Put, Delete (these are
the common ones)
Request URL ==> the URL of the resource
Request Header ==> Accept-Language, AcceptEncoding, User-Agent, Host
Request Body ==> This is the data to be sent to the

HTTP RESPONSE
resource HTTP -RESPONSE- method is made up of three
components:
Response Status Code ==> 200, 301, 404, 500
(these are the most common ones)
Response Header Fields ==> Date, Server, LastModified, Content-Type
Response Body ==> This is the data that comes
back to the client from the server.