Friday, March 23, 2012

http interview questions


  • How does HTTP handle state?

It doesn’t, of course. Not natively. Good answers are things like “cookies”, but the best answer is that cookies are a hack to make up for the fact that HTTP doesn’t do it itself.

  • What are the basic Features of HTTP?


The basic features of HTTP are as follows:

    HTTP is a request and response protocol.
    HTTP is a media independent protocol.
    HTTP is a stateless protocol.
3) What are request methods in HTTP?

Following are the request methods:

    GET- It is used to send data in url.
    HEAD- It only transfers status line and header section as a request.
    POST- It is used to send data to the server.
    PUT- It is used to send entire updated data to the server.
    DELETE. Delete method sends a request to the server to perform delete operation.
    CONNECT- It is used to establish connection to the server.
    OPTIONS- Option method describes communication options for target resource.
    TRACE- It performs message loop-back test along the path to the target resource.
4) What are the differences between GET and POST method?

Following are the differences between GET and POST method:
Get Post
It is cached. It cannot be cached.
It sends data using url in the browser. It does not send data into the url.
It can send limited amount of data to the server. We can send data in bulk to the server.

5) What is status code in HTTP?
There are two major group of HTTP status code error exist:

    4xx Client Error
    5xx Server Error
6) What are the header fields in HTTP?

HTTP headers fields allow the client and server to pass information with the request and response message.

Following are the header fields in HTTP:

    General header- It applies for both request and response message.
    Request header- It contains information for the request message.
    Response header- It is used to contain response header information sent by the web server.
    Entity header- It is used to contain more information about the body of the entity.
7) What is URI?

URI (Uniform Resource Identifier) is used to define the identity of something on the web. It can represent a piece of an url.
https://www.tutorialandexample.com/http-interview-questions/


  • Explain Idempotent methods and web applications?

Methods PUT and DELETE
are defined to be idempotent, meaning that multiple identical requests should have
the same effect as a single request. Methods GET, HEAD, OPTIONS and TRACE, being
prescribed as safe, should also be idempotent, as HTTP is a stateless protocol.


What is Persistent connections?
In HTTP/1.1 a keep-alive-mechanism was introduced, where a connection could be reused
for more than one request.

What is HTTP session state?
HTTP
is a stateless protocol. A stateless protocol does not require the server to retain
information or status about each user for the duration of multiple requests. For
example, when a web server is required to customize the content of a web page for
a user, the web application may have to track the user's progress from page
to page. A common solution is the use of HTTP cookies. Other methods include server
side sessions, hidden variables (when the current page is a form), and URL-rewriting
using URI-encoded parameters, e.g., /index.php?session_id=some_unique_session_code.
http://www.iexamcenter.com/question/hypertext-transfer-protocol--http--interview-questions.html

No comments:

Post a Comment