Should mail-tracking forms use GET?

8 views
Skip to first unread message

Ram Rachum

unread,
Feb 1, 2012, 7:15:20 AM2/1/12
to pyweb-il
Hey folks,

Once again I have a question about something in web that has nothing to do with Python.

You know how, when you order some product delivered, you get a tracking number for your package? Then you can track the delivery of your package online. You do this on various websites, like israelpost.co.il if it's in Israel, or other postal service websites in other countries if you ordered something from abroad.

One thing that annoys me though, is that the form to enter a tracking number is often not in GET, but in POST. This means that I can't have a constant URL for the tracking of my packages! For example I wanted to make a memo for myself for a week from now to check the status on the tracking page, and I wanted to include a URL of that tracking page, but I can't give a direct URL to the result, only the URL of the form and a tracking number.

What do you think, is there a good reason to make this form POST and not GET?


Ram.

Yuval Adam

unread,
Feb 1, 2012, 11:55:34 AM2/1/12
to pywe...@googlegroups.com
Not entirely sure what the issue here is, I might be missing something.

This has nothing to do with the HTTP method, but how you design your URLs.
You can either have a direct URL with the data http://example.com/track/ABCD1234 or send it as a GET param http://example.com/track?packageid=ABCD1234

The form page itself should usually make a GET call since it's more semantically correct.
If I'm missing something as to why you can't have a direct URL to track the package, please make it more clear.

--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To post to this group, send email to pywe...@googlegroups.com.
To unsubscribe from this group, send email to pyweb-il+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyweb-il?hl=en.



--
Yuval Adam
http://y3xz.com


Ram Rachum

unread,
Feb 1, 2012, 12:00:03 PM2/1/12
to pywe...@googlegroups.com
A direct URL would be cool too, but it's a form, so it's either GET or POST, and then maybe redirection to a nice URL if you want.

I also don't see a reason why to use POST in this scenario. But then I saw several postal service websites of several countries that do use POST for this form. This makes me think that maybe they understand something I don't.

But then again, they could just be wrong.

So I'm hoping someone here can either think of a good reason to use POST in this scenario, or we could all conclude that the guys who build websites for postal services are just wrong for using POST instead of GET.

Yuval Adam

unread,
Feb 1, 2012, 12:11:42 PM2/1/12
to pywe...@googlegroups.com
Again:

/track renders the form page. Submitting the form via GET sends you to /track?packageid=ABCD1234 which also doubles as a permanent link. For aesthetic reasons, you can also have /track/ABCD1234 if you want.
All bases are covered, no problem.

Why is POST used in some cases? I have no idea...

Dan Julius

unread,
Feb 1, 2012, 1:33:35 PM2/1/12
to pywe...@googlegroups.com
Maybe some browsers / proxies  cache the GET result instead of retrieving up-to-date information, 

Dan

Yuval Adam

unread,
Feb 1, 2012, 2:32:18 PM2/1/12
to pywe...@googlegroups.com
Huh? They should never do that if you set your HTTP cache-control headers properly.

Ram Rachum

unread,
Feb 4, 2012, 7:19:52 AM2/4/12
to pywe...@googlegroups.com
Okay, my conclusion from this thread (and the lack of arguments for GET) is that the developers of postal service websites are indeed wrong for using GET for these forms instead of POST.

Now I can patronize them without feeling that I might be wrong :)

Amit Kotlovsky

unread,
Feb 5, 2012, 4:12:33 AM2/5/12
to pywe...@googlegroups.com
Wasn't the conclusion that they are wrong for using POST rather than GET?
Thanks,
Amit Kotlovski

Ram Rachum

unread,
Feb 5, 2012, 8:36:26 AM2/5/12
to pywe...@googlegroups.com
Right, right, I mistakenly swapped GET or POST, d'oh!

So let me correct my last message:

My conclusion from this thread (and the lack of arguments for POST) is that the developers of postal service websites are indeed wrong for using POST for these forms instead of GET.

Udi Oron

unread,
Feb 6, 2012, 3:45:35 PM2/6/12
to pywe...@googlegroups.com
Hi!

Yep, it should be GET.

BTW, israelpost.co.il is very non standard, but surprisingly, they do have use GET in package tracking, it is just buried behind a weird redirect response.
Run the form with chrome developer tools with the network panel, with "Preserve Log upon Navigation" turned on to see it working:


Udi.


On Wed, Feb 1, 2012 at 2:15 PM, Ram Rachum <r...@rachum.com> wrote:

--

Ram Rachum

unread,
Feb 6, 2012, 4:08:14 PM2/6/12
to pywe...@googlegroups.com
On Mon, Feb 6, 2012 at 10:45 PM, Udi Oron <udi...@gmail.com> wrote:
Hi!

Yep, it should be GET.

BTW, israelpost.co.il is very non standard, but surprisingly, they do have use GET in package tracking, it is just buried behind a weird redirect response.
Run the form with chrome developer tools with the network panel, with "Preserve Log upon Navigation" turned on to see it working:


Wow!

Great work detective. 
35C.gif
Reply all
Reply to author
Forward
0 new messages