Download this Blogger Template by Clicking Here!

Ad 468 X 60

Showing posts with label Client/Server. Show all posts

Tuesday, 19 March 2013

Http Response And Its Message Format

The Http Response :


response
Response

When a client sends an Http Request to a server then Http Response is a response sent back to client from server.


Actually this article is in connected with the Working Of Online Php Program And RelationShip Of Client And Server.

Client and Server communicate with each other with the help of HTTP Protocol. Http Request And Http Response are Http protocol. For understanding it you must know that What is Http Protocol And Its Role In Client Server RelationShip This Protocol works in two ways. One is Http Request And the other is Http Response. Check Http Request to know about it.

Http Response Parts :


HTTP Response consists of three parts.

  • Response Line
  • Header
  • Body

Example Of Http Response


HTTP / 1.1 200 Ok
Date: Sat, 31st Oct 2012. 18:10:05 GMT
Server: Apache/ 1.3.12 (UNIX) (SUSE/Linux) PHP/4.0.2
Last-modified: 29th Oct 2012. 14:09:04 GMT


Http response
Http response

1). The Http Response Line :


Response Line Consists of two informations

  • Version : Version Number Of Http
  • Http Request Code : It is a code that reports whether the request has passed or failed

Consider this example of Http Response Line

HTTP/1.1200 Ok

Http Request Code:


In the above line 200 is the code. It means that request is successful and Http Response has the required data or page which is sent by the server. If response line code is 404, then it means error. 404 means that the requested page or data cannot be found by server and as a result a error page will be displayed on the browser (Error 404: Page Not Found)
There are also some other codes




Http Request Code Types



Code Class


Code Description

100-199

It means Request is still processing


200-299

It means Server has successfully processed the request


400-499

When a request Fails, this code class occurs


500-599


It means that the request was right But the server was unable to carry out it



2). The Response Header :


It is almost similar like HTTP Request Header.

Parts Of Response Header :


It has been divided into three parts

  • General: It has information about client and server
  • Entity: This part contains the data information which is exchanged between server and client
  • Response: It contains the information based on server response

Example

Date: Sat, 31st Oct 2012. 18:10:05 GMT /* The general Header */
Server: Apache/ 1.3.12 (UNIX) (SUSE/Linux) PHP/4.0.2 /* The Response Header */
Last-modified: 29th Oct 2012. 14:09:04 GMT/* The Entity Header */

In the first line general Header is shown which shows the time and date. In the second the Response Header is shown which provides server information. In the third line Entity Header is shown which shows the time of last modification in the page

The Response Body:


If a request is successful then response body sends HTML code and client side scripts back to the browser after rendering. If the request is failed then server sends an error back to the client


Run Php script with  HTTP Request :


It is not necessary that client will always be a web browser. Every client that can send Http request can run php program on server. If a correct and proper formatted request is send to a server and the sent Request identifies the proper php file on server with php extension then it can run the php program.


Http response tutorial in urdu
Http response tutorial in urdu


Http response Php tutorial in urdu
Http response tutorial in urdu

php response tutorial in urdu
php response tutorial in urdu


Share It
Share It


Read More »

Sunday, 17 March 2013

What is Http Protocol And Its Role In Client Server RelationShip ?

What Is Http protocol ?

Ip Address :


Ip Address
Ip Address


You might have heard about IP address. It is a protocol which is given to computers on a network in form of address like (127.0.0.1). Because Of this address computers can communicate with each other. IP address and computers communication with each is a different and detailed topic. IP address is an internet protocol.We will discuss it in our coming tutorials. 

Http Protocol :


Just like IP there is another Protocol named HTTP " Hyper text Transfer Protocol " . Http is a protocol which is used to transfer data worldwide from one computer to another computer globally. When we type the address of a website then we first add http:// in start of address. Sometimes it is automatically added by the browser in the start of the address of website. Server and Client communicate with each other using this protocol.

What Is Http Request And Http Response :


Http Request And Http Response
Http Request And Http Response


When a request is sent from browser to web server then this request is called Http Request. We have learnt in our previous tutorial about working of CLient/Server that when a server receives a request for a page then it returns the processed page back to the client and if the server cannot find that requested page then It gives a error ( Error : 404 page not found ) The error message or response or the processed page / data which is sent by the sever to the browser is called Http response.

Http Protocol And Its Role In Client Server RelationShip :


When a request is received by a server then there is also some data in the request along with the website URL.  In the same way when a server gives response then there is also a lot of information which it sends back to the web browser. The information and knowledge data that is transferred and exchanged between server and client is all automatically produced and processed. A user has to do nothing with it. Therefore we do not need to worry about these as a user, but as a developer we should have complete knowledge about these communications between client and server. This communication is made with the help of HTTP Request and HTTP Response.

Http Message And Its Parts :


It is important to know that whether it is a Client Request or Server Response  every message is a Http Message and format of every Http message is same.

Http message has three parts

  • Http body
  • Http header
  • Header Request/Response Line

Whether it is a Http Response And Http Request , both messages have the above three parts.

We will be explaining All these parts in detail and briefly in next tutorial. So subscribe to our email and Join Us on Facebook. Follow Us On Twitter . Find Us on Google+


Share It With Others. Thanks.

Php Tutorial In Urdu :


Php Tutorial In Urdu
Php Tutorial In Urdu




Read More »