Protocolo Htpp

Páginas: 7 (1666 palabras) Publicado: 1 de septiembre de 2011
What is HTTP?
HTTP stands for Hypertext Transfer Protocol. It's the network protocol used to deliver virtually all files and other data (collectively called resources) on the World Wide Web, whether they're HTML files, image files, query results, or anything else. Usually, HTTP takes place through TCP/IP sockets. A browser is an HTTP client because it sends requests to an HTTP server (Webserver), which then sends responses back to the client. The standard (and default) port for HTTP servers to listen on is 80, though they can use any port.

What are "Resources"?
HTTP is used to transmit resources, not just files. A resource is some chunk of information that can be identified by a URL (it's the R in URL). The most common kind of resource is a file, but a resource may also be adynamically-generated query result, the output of a CGI script, a document that is available in several languages, or something else. While learning HTTP, it may help to think of a resource as similar to a file, but more general. As a practical matter, almost all HTTP resources are currently either files or server-side script output.

Structure of HTTP Transactions
Like most network protocols, HTTPuses the client-server model: An HTTP client opens a connection and sends a request message to an HTTP server; the server then returns a response message, usually containing the resource that was requested. After delivering the response, the server closes the connection (making HTTP a stateless protocol, i.e. not maintaining any connection information between transactions). The format of the requestand response messages are similar, and English-oriented. Both kinds of messages consist of: • • • • an initial line, zero or more header lines, a blank line (i.e. a CRLF by itself), and an optional message body (e.g. a file, or query data, or query output).
value1 value2 value3

Put another way, the format of an HTTP message is:

Initial lines and headers should end in CRLF, though youshould gracefully handle lines ending in just LF. (More exactly, CR and LF here mean ASCII values 13 and 10, even though some platforms may use different characters.)

Initial Request Line
The initial line is different for the request than for the response. A request line has three parts, separated by spaces: a method name, the local path of the requested resource, and the version of HTTP beingused. A typical request line is:
GET /path/to/file/index.html HTTP/1.0

Notes: • GET is the most common HTTP method; it says "give me this resource". Method names are always uppercase. • The path is the part of the URL after the host name, also called the request URI (a URI is like a URL, but more general). • The HTTP version always takes the form "HTTP/x.x", uppercase.

Initial Response Line(Status Line)
The initial response line, called the status line, also has three parts separated by spaces: the HTTP version, a response status code that gives the result of the request, and an English reason phrase describing the status code. Typical status lines are:
HTTP/1.0 200 OK

or
HTTP/1.0 404 Not Found

Notes: • The HTTP version is in the same format as in the request line,"HTTP/x.x". • The status code is meant to be computer-readable; the reason phrase is meant to be humanreadable, and may vary. • The status code is a three-digit integer, and the first digit identifies the general category of response: • 1xx indicates an informational message only • 2xx indicates success of some kind • 3xx redirects the client to another URL • 4xx indicates an error on the client's part •5xx indicates an error on the server's part The most common status codes are: 200 OK The request succeeded, and the resulting resource (e.g. file or script output) is returned in the message body. 404 Not Found The requested resource doesn't exist. 301 Moved Permanently 302 Moved Temporarily 303 See Other (HTTP 1.1 only) The resource has moved to another URL (given by the Location: response...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • trabajo de htpp
  • Htpp
  • Htpp
  • htpp
  • Web, htpp, tcp ip
  • Protocolo
  • Protocolos
  • Protocolo

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS