post in CGI scripts

Greg Jorgensen gregj at pobox.com
Fri Jan 12 01:49:41 EST 2001


"Arthur" <alembert at mypad.com> wrote in message
news:93lsr8$did$1 at nnrp1.deja.com...
> In article <mailman.979051149.6515.python-list at python.org>,
>   Barbini Uberto <Uberto.Barbini at ceda.polimi.it> wrote:
>
> > I've found some problems to use "post" method in my cgi script (in
> python).
>
> I don't understand the difference between 'get' and 'post' methods.
> I learned that 'get' will send data in /cgi-bin/<program>?<data> format
> but how does 'post' send data? and why 'post' was created?

GET requests a resource (document, etc.) from the server. POST sends
information to the server. GET and POST overlap to some degree because in
both methods can send encoded parameters in the URL, which the server can
parse and pass to a CGI or other handler. But POST can send data to the
server that GET can't: binary data (such as file uploads), big chunks of
data, and multipart MIME data.

The main practical differences are: GET puts everything in the URL, so the
user can see everything sent to the server. POST requests send data
separately from the URL. POST can send as much data as necessary to the
server, but browsers and servers impose limits on the length of URLs, which
restricts the amount of data that can be sent with GET.

--
Greg Jorgensen
PDXperts
Portland, Oregon, USA
gregj at pobox.com





More information about the Python-list mailing list