473,657 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is GET stateless ?

"A GET is not supposed to change the state of the resource"
(compared to a POST, which obviously can)

Now this isn't my statement, I don't personally support it, it's
clearly breached on a regular basis and I can;t find anything in RFC
2616 et al. to support it.

What does the team think ?

Jul 20 '05 #1
11 1996
On Mon, 15 Sep 2003, Andy Dingley wrote:
"A GET is not supposed to change the state of the resource"
(compared to a POST, which obviously can)

Now this isn't my statement, I don't personally support it, it's
clearly breached on a regular basis and I can;t find anything in RFC
2616 et al. to support it.

What does the team think ?


The clap-o-meter says:

http://www.w3.org/Protocols/rfc2616/....html#sec9.1.2

___
/
Methods can also have the property of "idempotenc e" in that (aside
from error or expiration issues) the side-effects of N > 0 identical
requests is the same as for a single request. The methods GET, HEAD,
PUT and DELETE share this property. Methods can also have the
property of "idempotenc e" in that (aside from error or expiration
issues) the side-effects of N > 0 identical requests is the same as
for a single request. The methods GET, HEAD, PUT and DELETE share this
property.
\___

Jul 20 '05 #2
Andy Dingley wrote:
"A GET is not supposed to change the state of the resource"
(compared to a POST, which obviously can)

Now this isn't my statement, I don't personally support it, it's
clearly breached on a regular basis and I can;t find anything in RFC
2616 et al. to support it.

What does the team think ?


The relevant part of RFC 2616 is:

"In particular, the convention has been established that the GET and HEAD
methods SHOULD NOT have the significance of taking an action other than
retrieval. These methods ought to be considered "safe". This allows user
agents to represent other methods, such as POST, PUT and DELETE, in a
special way, so that the user is made aware of the fact that a possibly
unsafe action is being requested."

-- <URL:http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9. 1>

It's not a MUST NOT, only a SHOULD NOT, but I think it should be listened to
in virtually all cases. If you really must use GET for a "non-safe"
action, then you'll probably want to respond with a redirection once the
transaction has gone through, to avoid problems where the user hits reload.

Why don't you support it? Is there anything useful non-safe GET actions can
do that you cannot do any other way?
--
Jim Dabell

Jul 20 '05 #3
>>>>> "Jim" == Jim Dabell <ji********@jim dabell.com> writes:

Jim> Why don't you support it? Is there anything useful non-safe GET actions can
Jim> do that you cannot do any other way?

You can't make a link like

<a href="/some/cgi/script?id=123"> delete this item</a>

that isn't a button.

Of course, indexers will be happy to follow this link, and delete your
item. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<me****@stonehe nge.com> <URL:http://www.stonehenge. com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.St onehenge.com for onsite and open-enrollment Perl training!
Jul 20 '05 #4
I noticed that Message-ID:
<58************ *************** ***@news.terane ws.com> from Randal L.
Schwartz contained the following:
You can't make a link like

<a href="/some/cgi/script?id=123"> delete this item</a>

that isn't a button.

Of course, indexers will be happy to follow this link, and delete your
item. :)


Bugger, hadn't thought of that[1]. How would you do it with a button?

[1]the page is password protected so indexers will not see it - I hope.
--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 20 '05 #5
Geoff Berrow <$b**@ckdog.co. uk> wrote:
You can't make a link like

<a href="/some/cgi/script?id=123"> delete this item</a>

that isn't a button.

Of course, indexers will be happy to follow this link, and delete your
item. :)


Bugger, hadn't thought of that[1]. How would you do it with a button?


<form action="/some/cgi/script?id=123" method="POST">
<div><input type="submit" value="delete this item"></div>
</form>

It is debatable whether you could alternatively use

<form action="/some/cgi/script" method="GET">
<div><input type="submit" value="delete this item">
<input type="hidden" name="id" value="123"></div>
</form>

It might be argued that this violates a principle of using GET for fetch
operations only, but technically the protocol implies no such limitation.
If the delete operation is defined in the obvious way, so that trying to
delete something nonexistent has no effect (except sending back a warning
or an error message, perhaps), then it's idempotent.

Similar considerations apply to using a simple link. But in addition to
that, using a link for such a purpose is misleading. Links are supposed to
specify relationships, not actions. So even if you could, technically, set
up a link so that following the link makes a satellite self-destruct, and
you would not violate Internet protocols that way (the operation is surely
idempotent), you could hardly make the user responsible for the action.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #6
I noticed that Message-ID: <Xn************ *************** **@193.229.0.31 >
from Jukka K. Korpela contained the following:
Bugger, hadn't thought of that[1]. How would you do it with a button?


<form action="/some/cgi/script?id=123" method="POST">
<div><input type="submit" value="delete this item"></div>
</form>


Ah, a form. I knew that way, I thought there was another way I was not
aware of. I think I will change it so that each item has a check box and
then use a form button to delete selected items.

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 20 '05 #7
In article <Xn************ *************** **@193.229.0.31 >,
Jukka K. Korpela <jk******@cs.tu t.fi> wrote:

<form action="/some/cgi/script?id=123" method="POST">
<div><input type="submit" value="delete this item"></div>
</form>
Is it allowed to supply a query string in the URL of a POST?
Does it depend on the browser or server software in use?
idempotent.


This word is new to me and it's not in my Oxford Dictionary.
Can anyone enlighten me about its etymology?

--
James Taylor, Cheltenham, Gloucestershire , UK. PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.

Jul 20 '05 #8
James Taylor wrote:

Don't cross post replies please.
idempotent.


This word is new to me and it's not in my Oxford Dictionary.
Can anyone enlighten me about its etymology?


idempotent i¢dem*po*tent or i*dem¢pe*tent, (mathematics)
adjective and noun (of) a quantity which does not change value when
multiplied by itself.

(c) Larousse plc. All rights reserved
Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm
Jul 20 '05 #9
On Mon, Sep 15, James Taylor inscribed on the eternal scroll:
idempotent.
This word is new to me and it's not in my Oxford Dictionary.


You've been sold short. There's a sizeable web page on it in the
online OED. (The university conveniently has a subscription ;-)
Can anyone enlighten me about its etymology?


It's Latin, innit? idem = same, + potent(em) = powerful.

However, the thing to watch out for in its HTTP usage is that it does
_not_ mean that the operation has no effect. It only means that if
the operation is repeated, the effect is no different. Often loosely
explained as "producing no side-effects".

Jul 20 '05 #10

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

Similar topics

4
2755
by: MaxMax | last post by:
Now... I have a problem... It's an engineering problem. I have a function, we will call it MyBigFunc. It's a function that can be easily built as a static method, because it is the only function that the "user" will use and it is stateless. So I wrote something like: class MyClass { public: static int MyBigFunc() { return 0;}
375
17899
by: rkusenet | last post by:
This article is very bleak about future of DB2. How credible is the author. http://www.eweek.com/article2/0,1895,1839681,00.asp
5
3826
by: Steve - DND | last post by:
I've seen many threads on Google about questions regarding stateless classes, and thread synchronization. However, either I am dense, or I have just not found the right thread, but I'm still not clear on how it all works. I understand that if I have a static member variable such as a collection, then I need to lock those operations as below, correct? public class StaticClass { private static HashTable m_Hash = new HashTable(); public...
0
1142
by: Chip | last post by:
I'm having some serrious issues with this method. I love the fact that you don't need to worry about users not accepting cookies, but... The issue is using the complete URL, with session id, in bookmarks and links. I thought I had read that this wouldn't matter -- if someone bookmarked a URL, and went to the site with an old session id embedded it would simply issue a new session id. This doesn't happen. I've had the following problems: *...
10
1749
by: tatemononai | last post by:
The old ASP was stateless. Every single time you hit the server it was starting from scratch. Even though HTTP is still stateless, it is my understanding that ASP.Net solves this problem by hiding a unique code inside the form of the client, associating each client with their little block in memory on the server. When you post something it automatically fills your text boxes back up, etc. This is very convenient, but I'm having some...
2
1508
by: rengaraj | last post by:
Dear Friends, Develop a stateless session EJB bean and deploy it in WebLogic 8.1 Please proivde me a weblogic8.1 example along with the deployment steps. Also mention the supporting softwares needed. I have weblogic 8.1, JDK 1.5 Advance Thanks. Rengaraj.R
0
8403
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8509
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.