vendredi 24 juin 2016

Difference between PHP HTTP requests in relation to other languages (Ruby, Python, etc)

Reading Chris Fidao's Servers for Hackers (http://ift.tt/1EBu1Lc), I've noticed that there's some difference from how PHP processes HTTP requests from other languages (see PHP is Special on the link, but I'll paraphrase a part of it below):

PHP was originally built under the assumption that it is run during an HTTP request. It contained no process for converting the bytes of an HTTP request into something for code to handle. By the time the code was run, that was dealt with.

Conversely, other languages have a process of translating an HTTP request into code. This usually means parsing the bytes constituting HTTP request data.

Many libraries have been created as a language add-on to handle HTTP requests. Some newer languages can handle HTTP requests directly. These languages don't assume code is always run in the context of an HTTP request, however.

I read, read again but do not understood clearly, is it that when PHP ran, it already expects any input to be an HTTP request, while the other languages expect it to be code, and parse it to see if it is an HTTP request after?

The libraries he mention are like Ruby's Rack and Python's WSGI? or something like Ruby's Net::HTTP(I don't know the equivalent of Net::HTTP for python)?

Sorry if my english is bad, it is not my main language.




Aucun commentaire:

Enregistrer un commentaire