Maheshjayachandran / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Use of FormData #395

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Create an XhrIO object
2. Use a FormData as content
3. Send the request as POST

What is the expected output? What do you see instead?
When using the new FormData interface 
(http://www.w3.org/TR/XMLHttpRequest2/#the-formdata-interface) as opt_content 
for an XhrIo request, the check for content type header on line 500 on xhrio.js 
changes the expected value from  something such as 
"Content-Type:multipart/form-data; 
boundary=----WebKitFormBoundaryiwvuYZNwHL2wl5sB" to 
"Content-Type:application/x-www-form-urlencoded;charset=utf-8" and the web 
server is unable to process the request.

What version of the product are you using? On what operating system?
Tested using Chrome and Firefox.

Please provide any additional information below.
Setting the "Content-Type" header as null completely removes it from the 
request.

Original issue reported on code.google.com by nican...@gmail.com on 26 Nov 2011 at 6:00

GoogleCodeExporter commented 9 years ago
Is it true that your content object will be an instance of window.FormData?  
Would it be sufficient to put that check in?

In any case, this should be taken into accoun in the design of labs' new XHR 

Original comment by nn...@google.com on 11 May 2012 at 7:33

GoogleCodeExporter commented 9 years ago
>a = new FormData()
>a instanceof window.FormData
>> true

It would suffice for this one case, but I would recommend taking a look at the 
different possibilities for sending data, FormData is not the only valid object 
type:
http://www.w3.org/TR/XMLHttpRequest2/#the-send-method

Original comment by nican...@gmail.com on 11 May 2012 at 8:09

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2116.

Original comment by Nicholas.J.Santos on 21 Aug 2012 at 9:18