Friday, 11 November 2016

HTTP


Whats Http ? whats the concept ?


http you can say is the language between the two machines , what they understand and based on that how they behave .

its a protocol , a kind of set of rules to understand and respond back among the machines connected on the internet like we connect in english ,latin or french .








Every server side has a http daemon , as soon as you open a web page , it send a request to the server daemon of the respected server side and with proper http headers , now the story starts for the http , it understand the requests and based on that it sends a web page , a file , a song , a video or whatever you want my friend .


this is the whole and soul of http , want to learn more about it , tons of information is present on wikipedia but that wont be mandatory as per now .




HTTP and PHP , request and their response ??

if you have used php and worked out with the requests and response then you would be knowing that php makes you takes the request from some special superglobal arrays .
For Example , this figure will explain it :-




 in these superglobal arrays we capture the request variables and hence use them further .


When we send a response from simple php we send the headers with it to the browser , sending headers means making the respective browser understand whether the stream response is a text ,and image , a binary file , a mp3 song or anything possible which browser can render .

So in this way the request and response is done between php and browser .

Several http codes are there which lets u know what kind of response came , either it a sucess or a failure or some thing else like , request was not appropriate etc .

Just for an idea , i am posting majorly used http codes as per industry standards .







Its a bit different in the case of symfony , lets come to that .












No comments:

Post a Comment