http request body code example
Example 1: 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.
Example 2: request body
Request Payload has
ENDPOINT (Specific URL where we send our requests to a certain web service. )
METHOD (Get•Post•Put•Patch•Delete)
HEADERS(Represents the metadata of
request or response. Like basically
we can verify the object type we are sending etc )
PARAMETERS(Parameters are to specifiying
even more about the request we are
sending like what specific resources
needs to be returned etc.)
BODY(Body is where we sent or received the request we made)
For the repsonse
Basically we are checking response body
to verify if request matches with response.
In the response we are verifying
(body, status code, header, response time,
test structure of json against the given jsonSchema)