Subject: [p1-messaging] 2.7.1. http URI scheme - [ "?" query ]

From: Ray Polk <[email-masked]>
Date: Thu, 19 Jan 2012 11:32:47 -0700

The spec doesn't seem to speak suggested/valid combinations of verbs and
query parameters (please point me to the location if I've missed it).

I've seen efforts to constrain the use of query parameters to just GETs.
 Others suggesting not to use query parameters for PUT/POST ("those values
should be a part of the entity" I've read).  Is this merely a sort of
grassroots best practice?

Is such advice misguidance?

If such guidance is good, is it appropriate for the spec to suggest it?

-Ray

---

From: Julian Reschke <[email-masked]>
Date: Thu, 19 Jan 2012 19:43:10 +0100

> query parameters (please point me to the location if I've missed it).

No, it does not.

>   Others suggesting not to use query parameters for PUT/POST ("those
> values should be a part of the entity" I've read).  Is this merely a
> sort of grassroots best practice?
>

I don't think it's good guidance.

Best regards, Julian

---

From: Willy Tarreau <[email-masked]>
Date: Thu, 19 Jan 2012 20:28:45 +0100

> I don't think it's good guidance.

Agreed, and I've already seen some apps making use of POST requests on
URLs containing a question mark without any issue. Most often it's just
a matter of what framework is used on the app side to distinguish
between args from the query string and args from the body.

Regards,
Willy

---

From: Ray Polk <[email-masked]>
Date: Thu, 19 Jan 2012 12:50:11 -0700

Possibly irrelevant (does this group care about common practices by user
agents?) but....are there clients that have issues with passing query
params to non GET verbs?  If many/most do have such a limitation, I can see
how people might try to avoid using query on other verbs.

(Neophyte question:  Is discussion of this sort seen as polluting this
mailing list?  ...or is it cool?)

---

From: Willy Tarreau <[email-masked]>
Date: Thu, 19 Jan 2012 22:29:10 +0100

On Thu, Jan 19, 2012 at 12:50:11PM -0700, Ray Polk wrote:
> params to non GET verbs?

It's always possible that some might exist somewhere but it doesn't seem
to be the common case. At least even an old seamonkey 1 and opera 8 here
have no problem at all with this :

Test code :
  <html><body><form method="POST" action="http://127.0.0.1:8000/foo?bar=1">
  <input type="hidden" name="var1" value="val1"><input type="submit">
  </form></body></html>

Request sent :
  POST /foo?bar=1 HTTP/1.1
  Host: 127.1:8000
  User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100301 SeaMonkey/1.1.19
  Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Accept-Language: en-us,en;q=0.5
  Accept-Encoding: gzip,deflate
  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Keep-Alive: 300
  Connection: keep-alive
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 9
  
  var1=val1

> If many/most do have such a limitation, I can see

I don't see any such reason. Right now it works at least for some clients,
so better not to suggest breaking something which works (and is already
used).

> mailing list?  ...or is it cool?)

All discussions that are cool to some are pollution for other ones
(including this one). Better focus on draft-18 review and bring here
any possibly missed issue.

Thanks,
Willy

---

From: Cameron Heavon-Jones <[email-masked]>
Date: Fri, 20 Jan 2012 11:33:50 +0000

Out of interest, this may be because HTML specifics form GET to target and overwrite the URI query whereas form POST will always target the request body.

I'm currently investigating if it may be possible to eliminate this restriction in addition to the declaration of headers via inputs in a proposal for HTMLWG issue - http://www.w3.org/html/wg/tracker/issues/195

Thanks,
Cam