HTTP Interview Questions for freshers experienced :-
1. What is HTTP?
HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web).
2. 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. 1. It cannot be cached.
- It sends data using url in the browser. 2. It does not send data into the url.
- It can send limited amount of data to the server. 3. We can send data in bulk to the server.
5. What is status code in HTTP?
It is a Standard response code given by web server on Internet. It helps to identify the cause of problem when web page or other resource does not load properly.
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.
8. What are Idempotent methods?
In idempotent methods, for the multiple requests, we get exact same result. It would no matter if the request is called one or ten times, the result should be same.
9. What is secure HTTP?
The secure HTTP is secure version of HTTP. In this protocol, data transfer over the World Wide Web is secure and encrypted. It is used to execute highly confidential online transaction like financial transactions.
10. What are the benefits of HTTPS certificate?
The major benefits of HTTPS certificate are:
- Customer information like credit card number and ATM pin is encrypted and cannot be easily track.
- Customers trust and prefer to purchase from the sites that use HTTPS protocol.
- This protocol shows authenticate register domain as secure connection.
11. What is cURL in HTTP?
cURL is command line tool. It is available on all major operating systems.
12. What is REST?
REST stands for Representational State Transfer. It is a set of constraints that ensure a scalable, fault-tolerant and easily adaptable system. It relies on a stateless, client server and cacheable communications protocol.
13. What is DNS spoofing?
DNS spoofing is a type of computer attack where user is forced to navigate to a fake website to look like real one. Its intention is to diverting traffic and to get user data.
14. What is 500 internal server errors?
Web server displays 500 internal server error, when processing fails due to some unanticipated incident on the server side.
15. What is HTTP 409 response code?
When we use PUT request to create the same resource twice then server displays 409 code to the browser.
16. What is the mean of HTTP 405 error “Method not allowed”?
Web Server displays the HTTP 405 error message, when requested method is not allowed. Ex. if a resource allows get method, we cannot request post to get this resource.
17. What is HTTP 401 response code?
This response code is generated when an unauthorized user request for secure resource on the web server.
18. What is HTTP 404 Not found response code?
This 404 code indicates that the requested resource is not available at the web server.
19. What is HTTP 400 Bad Request response code?
This request shows malfunction. It display specially with POST and PUT requests, when the data does not pass validation.
20. What is HTTP 201 Created response code?
This indicates that the request was successful. It is used to confirm success of a PUT or POST request.
21. What is HTTP 200 OK response code?
It indicates that the request is successful.
22. What Is Secure Http?
There are currently two methods of establishing a secure HTTP connection: the https URI scheme and the HTTP 1.1 Upgrade header, introduced by RFC 2817. Browser support for the Upgrade header is, however, nearly non-existent, so HTTPS is still the dominant method of establishing a secure HTTP connection. Secure HTTP is notated by the prefix https:// instead of http:// on web URIs.
23. 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.
24. What Is Curl In Http?
cURL is a command line tool that is available on all major operating systems.
25. From What Http Messages Are Made?
HTTP messages are made of a header and a body. The body can often remain empty; it contains data that you want to transmit over the network, in order to use it according to the instructions in the header. The header contains metadata, such as encoding information; but, in the case of a request, it also contains the important HTTP methods. In the REST style, you will find that header data is often more significant than the body.