POST vs GET

Joe Sirott Joe.Sirott at noaa.gov
Fri Dec 22 16:58:02 PST 2006


Nathan,

The POST that is equivalent to:

GET  /opendap/param1=foo&param2=bar HTTP/1.1

is:

*POST */opendap/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded

param1=foo&param2=bar

- Joe

Nathan Potter wrote:
>
> On Dec 22, 2006, at 3:33 PM, Joe Sirott wrote:
>
>> I believe that the mime-type is used by most servers to determine the 
>> action to take with a HTTP POST. The action should be exactly the 
>> same as a HTTP GET if the client uses a mime type of 
>> application/x-www-form-urlencoded in the request.
>
>
> I tried adding:
>
> Content-Type: application/x-www-form-urlencoded
>
> and then
>
> MIME-Type: application/x-www-form-urlencoded
>
> to the MIME header that I sent with my get request to the the test 
> servlet. In neither case did the HttpServletRequest.getReader() return 
> show content in the returned BufferedReader.
>
>
> My requests looked like:
>
>
>
> GET /opendap/ HTTP/1.1
> Accept: */*
> Accept-Language: en
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) 
> AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3
> Content-Type: application/x-www-form-urlencoded
> Host: 127.0.0.1:3001
>
> Stuff about Stuff that we might know about stuff that contains stuff.
> Stuff about Stuff that we might know about stuff that contains stuff.
> Stuff about Stuff that we might know about stuff that contains stuff.
>
>
>
> and:
>
>
>
> GET /opendap/ HTTP/1.1
> Accept: */*
> Accept-Language: en
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) 
> AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3
> MIME-Type: application/x-www-form-urlencoded
> Host: 127.0.0.1:3001
>
> Stuff about Stuff that we might know about stuff that contains stuff.
> Stuff about Stuff that we might know about stuff that contains stuff.
> Stuff about Stuff that we might know about stuff that contains stuff.
>
>
>
>
>
> Did I misunderstand about how to specify the 
> "application/x-www-form-urlencoded" term?
>
> N
>
>
>
>
>> In fact, this can be absolutely essential as it can be the only way 
>> to get around HTTP server limits on the line length of HTTP GETs. You 
>> shouldn't have to add any special tokens to the URL to do this. SOAP 
>> requests should have a mime type of application/soap+xml.
>>
>> If DAP 4 is going to use SOAP, then I hope it's going to be 
>> document/literal SOAP. The rpc/encoded style is pretty ugly.
>>
>> - Joe
>>
>
> =======================================================
> Nathan Potter                        The OPeNDAP Project
> ndp at opendap.org                       http://opendap.org
> 541.752.1852 voice
>
>
> The OPeNDAP Developer's Meeting will be held on
> 21-23 Feb 2007 in Boulder CO.
>
> See the  Developer's Wiki:
> "http://wiki.opendap.org/twiki/bin/view/Developers/DevMeeting2007"
> for more details.
>
> =======================================================
>
>



More information about the Opendap-tech mailing list