Two kinds of HTTP POST

I could not figure out why my Indigo services did not receive an HTTP POST from the browser. If I composed the HTTP POST programmatically everything would work. However, if I posted a form with a browser, the service would not receive the message.

As it turns out, the fundamental type Indigo expects is "Content-Type: application/xml" and the browser uses "Content-Type: application/x-www-form-urlencoded".

I imagine there is a way to tweak Indigo to receive both but I was happy to find out reason for failure.

-abel-
 
---------------
Indigo
---------------

POST /customers/ HTTP/1.1
Content-Type: application/xml; charset=utf-8
Host: mr2.mit.edu
Content-Length: 167
Expect: 100-continue
Connection: Close

<Customer xmlns="http://tempuri.org/Customer" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Address>2323 Lake Shore Drive</Address><Name>Alice</Name></Customer>

---------------
Browser
---------------

POST /Target HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, application/ag-plugin, */*
Referer: http://localhost:50839/FileUpload/Upload.htm
Accept-Language: en-US,zh-CN;q=0.5
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 3.5.20404)
Host: mr2.mit.edu
Content-Length: 16
Connection: Keep-Alive
Cache-Control: no-cache

submit-name=Abel

Filed under:

Comments

No Comments