What is the difference between “Request” and “Response” terminologies in ASP.net?
I am using ASP.net 3.5.
Suppose I have to make somebody understand about these terms. What should i say ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Request is what a web client sends to the web server. The Response is what the web server sends – well, in response. Both are defined in the HTTP specification. (How they are structured, what information and meta data they include, etc.)
ASP.Net encapsulates these concepts in respective classes to make them programmatically accessible.
Edit: Specific examples as requested in the comments:
Request.QueryString
If you have a URL like the following:
http://www.host.com/Page.aspx?name=Henry&lastName=FordThe part after the
?is the query string. (name=Henry&lastName=Ford <= The query string)This is one common way to pass arguments to the server as part of the Request. In your server code you can access these arguments by using
Request.QueryString:Response.Redirect
Your server received a Request for a page and you want to redirect to another location. With the
Response.Redirect()method, you add a specific piece of information to the Response that causes the browser to immediately go to this other page.