Re: Get and Post



Phlip writes:

Filling in a bit here...

> To GET a page, use http://www.c2.com/ . Your web browser sends one raw
> string to the server.

A GET can consist of several lines. Various headers may follow the initial
line. A GET looks like this:

GET /foo/bar/page.html HTTP/1.0
User-Agent: <name-of-user-agent>
My-Header: <my-value>
<blank-line>

> To GET a scripted page, use http://www.c2.com/cgi/wiki?ZeekLand . The ?
> delimits the script arguments, and a page can encode anything to its URL,
> typically delimited into a map of variables and values with & and = marks.

"Scripted" may include compiled programs that handle what is often called
"search" information or parameters. I've written a number of compiled
programs that handled URI info over the years.

The & (ampersand) delimits individual fields that consist of <name>=<value>
pairs. A GET with search info looks like this:

GET /foo/bar/page.html?id=23341&page=3&name=Fred+Smith HTTP/1.0
<headers>
<blank-line>

> For example, a Google search returns a page with a big long URL.

That search engines make big use of URI extra data is exactly why they
are often called "search parameters". (-:

> To POST, however, you send an URL like http://www.c2.com/cgi/wiki , but with
> POST in the HTTP header. The message will also contain a complete block of
> data, encoded for processing, but not built directly into the URL. POST
> typically satisfies a <form> tag's <submit> button.

Depends on the method selected in the <form> tag. A form can use GET or
POST. Most use POST for the obvious reason of not creating huge URIs.
POST might look like this:

POST /foo/bar/page.html HTTP/1.0
<headers>
<blank-line>
<------lottsa encoded data------->

> Now crack a book!

Or go to the defining source: RFC-1945 (http 1.0) and RFC-2068 (1.1).

.