HTTP Contain HTTP Header and HTTP Body separated by single empty line
Key Element of HTTP request
- Form data
- HTTP method( if present)
- Every web resources must have its unique address in form of web URL.
- URL present in Header part of HTTP request.
- Data collected using HTML form is called form data and in HTTP request its optional information
- If it is present then it will be present in header or body part of the HTTP request depending on the HTTP method present in the request.
- It indicates desired action to be performed on dynamic web resources
- HTTP has a different method and In Servlet we implement that method based on action to be performed.
- This all Default implementation of method present in Servlet API javax.servelet.httpservlet
Key Element of HTTP response
- Status code
- Content type
- Actual content
- Cookies( if present)
- Status code represent status of HTTP request
- It is mandatory information and it will be present in Header part of HTTP response.
- Content type tells the browser what type of content its going to receive so that it can prepare itself to handle response data
- Exa. make use of adobe plugin to handle pdf file.
- It is mandatory information and it is present in header part of HTTP request.
List of Content Type