473,388 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

GET or POST method?

Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

Jan 15 '08 #1
8 2380
Hello,

on 01/15/2008 12:19 AM Kurda Yon said the following:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jan 15 '08 #2
On Tue, 15 Jan 2008 Kurda Yon <ku******@yahoo.comwrote:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
Use GET when your script is getting information to display to the user.
e.g. A product display get for product id=1, you want to GET the information.

Use POST when you are posting information back to the script to be manipulated
in some fashion.
e.g. Submitting a form with an email for subscription to a newsletter. You
want to POST the information to the script to be handled by a database of
some sort.

D.
--
Superman wears Paul O'Connell pyjamas.
Jan 15 '08 #3
Manuel Lemos wrote:
Hello,

on 01/15/2008 12:19 AM Kurda Yon said the following:
>Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.
Incorrect. There is no standard, and different browsers handle things
differently. I've seen people pass 1K in a GET request - although I
definitely do NOT recommend it! :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 15 '08 #4
Kurda Yon wrote:
Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?

Another consideration - GET URLs can be bookmarked. POST URLs cannot.
So, for instance, if you're displaying a restaurant from a list, GET
would be good so the user could bookmark it. But if you're adding data
to a database, you wouldn't want them to add it every time they visit
the page so you'd want to use POST.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jan 15 '08 #5
Kurda Yon:
I have to decide which form-method I should use (GET or POST).
http://www.w3.org/2001/tag/doc/whenToUseGet.html

--
Jock
Jan 15 '08 #6
Jerry Stuckle wrote:
Manuel Lemos wrote:
>I think with GET you are limited to sending with no more than 255
characters. Above that the browser may chop your submission URL.

Incorrect. There is no standard, and different browsers handle things
differently. I've seen people pass 1K in a GET request - although I
definitely do NOT recommend it! :-)
Although browsers, proxies and servers are free to support URLs of any
length, HTTP/1.1 [1] does explicitly mention 255 characters as the length
above which people ought to exercise caution.

____
1. Hypertext Transfer Protocol -- HTTP/1.1
<http://www.ietf.org/rfc/rfc2616.txt>,
R Fielding, J Gettys et al, 1999.
3.2.1: General Syntax.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 15 days, 23:42.]

GPS & Cameras
http://tobyinkster.co.uk/blog/2008/01/14/gps-cameras/
Jan 15 '08 #7
Jerry Stuckle wrote:
Another consideration - GET URLs can be bookmarked. POST URLs cannot.
So, for instance, if you're displaying a restaurant from a list, GET
would be good so the user could bookmark it. But if you're adding data
to a database, you wouldn't want them to add it every time they visit
the page so you'd want to use POST.
And another: Login forms should normally be POSTed, so as not to reveal
the password in the browser's address bar.

One more: for file uploads, you'll need to POST.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 15 days, 23:49.]

GPS & Cameras
http://tobyinkster.co.uk/blog/2008/01/14/gps-cameras/
Jan 15 '08 #8
David Gillen wrote:
On Tue, 15 Jan 2008 Kurda Yon <ku******@yahoo.comwrote:
>Hi,

I have to decide which form-method I should use (GET or POST). I found
the following recomendation:
If the service associated with the processing of a form has side
effects (for example, modification of a database or subscription to a
service), the method should be POST. (http://www.cs.tut.fi/~jkorpela/
forms/methods.html).

However, later I did not find any convinced arguments why it should
help (it can be that I just did not understand something).

So, I have decided not to go into the details of GET and POST methods
and just use POST. Is here any significant difference between GET and
POST which I should worry about (like security issues or something
else)? Or it is just question of convenience?
Use GET when your script is getting information to display to the user.
e.g. A product display get for product id=1, you want to GET the information.

Use POST when you are posting information back to the script to be manipulated
in some fashion.
e.g. Submitting a form with an email for subscription to a newsletter. You
want to POST the information to the script to be handled by a database of
some sort.

D.
Either method works: a GET method is slightly insecure, in that an
average idiots can fake a URL and maybe get where they shouldn't: Its
harder to do with POST. There you would have to make up a web page form
to submit with POST to the URL you were trying to screw with.

Get is nice because you can use links to get to a GET enabled page..no
need to carate a form or anything.

I tend too use get for simple indexing into a page of data, and POST to
do the real work. Many of my scripts accept both.


Jan 15 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
2
by: Asp Help | last post by:
I'm working on a ASP applicatition to create Windows 2000 users. Because I don't want everybody to have access to the site I've changed te security in IIS 5.0 which runs on a windows 2000 Sp4...
2
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
5
by: Tammy | last post by:
Hi, I have an aspx app which needs to post data to a form and read the response. I am confused on whether I should be using the get_url using "POST" method or the post_url using "GET" method. ...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
24
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.