Edentity Web Systems
You solve creative. We crack code.
/Header/WhoWeAre.jpg
 

01/19/2010 411 Length Required in Firefox 3
Posted by Andre Small

When using AJAX in FF3.0.x you need to be careful if you are doing a post to webservice method or any end-point that does not accept any parameters as you may get a "411 Length Required - HTTP Error 411. The request must be chunked or have a content length." error from the server.

Since you are not sending any parameters to service, a Content-length header of 0 is set in the request. To fix this, add an empty javascript object. In the case of jQuery, it would look something like this (the change is highlighted in bold):

$.ajax({

type:

"POST",

url: "MyService.

 

asmx/Logout",

contentType:

 

"application/json; charset=utf-8",

data: {},

success:

 

function (msg) { //... },

error:

 

function (e) { //... }

});

 

This was tested and verified on FF3 and IIS 7.

« Back to Blog Main Page |

0 Comment(s)

Leave Comment

Name:
Comment:  
 
Edentity Web Systems Inc.
Suite 201
40 Spadina Ave.
Toronto ON
M5V 2H8
Tel:
416.591.2500
Fax:
416.352.5270

From Our Blog

02/09/2010
Amazon S3 – Now with Versioning! Posted by Joel Varty
02/02/2010
01/19/2010
411 Length Required in Firefox 3 Posted by Andre Small
Home | Who We Are | What We Do | Clients & Brands | Careers | Contact

Copyright © 2010 Edentity Web Systems Inc. Privacy Policy