From the course: Java EE: Servlets and JavaServer Pages (JSP)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using request/response objects

Using request/response objects

From the course: Java EE: Servlets and JavaServer Pages (JSP)

Start my 1-month free trial

Using request/response objects

- [Instructor] Now let us talk about another API which is the HTTPServletRequest object. We have been using this API over and over in all our previous demos. Now whenever you make a request from the client to the server, the request is represented in terms of this object. This is the one which extends the ServletRequest API and provides all the request information to the HTTP servlets. It consists of two parts, the headers and the body. The headers is all the extra information that you may need for the request, let's say, what type of content are you sending from the client to the server. Or let's say what is the browser information. Which is the browser through which you are making this request? So all this kind of extra information sits usually in the form of headers. The body, however, will contain the data that you are sending along with the request. As for the get request, the data is never in the body but it is always visible in the URL in the form of a query string…

Contents