Differentiate between request and response object with example.
Request Object
- The Request object makes available to our script all the information that the client provides when requesting a page submitting a form.
- This includes the following:
- the HTTP variables that identify the browser and the user,
- the cookies that they have stored on their browser for this domain, and any values appended to the URL, either as a query string or in HTML, controls in a <FORM> section of the page.
Response Object
- The Response object is used to access the response that we are creating to send back to the client.
- It makes the following available to our script: the HTTP variables that identify our server and its capabilities, information about the content we're sending to the browser, and any new cookies that will be stored on their browser for this domain.
The difference between RequestObject and Response Object are as follows:-
-"Request Object " is used to read the data submitted by the client (i.e. the data comes with the client request)
-"Response Object" is used to send instructions to the client browser.
-Request Object is used to get the information from the user.
-The request object is going to hold information about the current user request, that is the client browser requesting a webpage from your server.
-The response object contains the response data that will be sent back to the user.
-Response Object is used to the server will give the response to the user.
Comments
Post a Comment