This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 211729

Summary: The HTTP Monitor does not recognize POST parameters sent with XMLHttpRequest (AJAX) from Firefox
Product: javaee Reporter: mr212
Component: HTTP MonitorAssignee: issues@javaee <issues>
Status: REOPENED ---    
Severity: normal CC: ctalkobt
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description mr212 2012-04-25 17:04:47 UTC
When a POST request with form data is sent to the webserver (in my case Tomcat 7.0.22) via XMLHttpRequest (AJAX) from a newish version of Firefox (e.g. 11.0, but it's probably the same on a long chain of older versions), the request parameters are not shown in the HTTP Monitor and the message is "Data sent with this request was not parameterized".

The reason is that on setting Content-Type to application/x-www-form-urlencoded Firefox automatically appends '; charset=UTF-8" to the Content-Type header. This is valid HTTP, but it breaks the parameter recognition for the HTTP Monitor (not for the webserver itself).

One can navigate around the problem by not using the .send(data) method of XMLHttpReqest but .sendBinary(data) instead - which suppresses appending of the character encoding to the Content-Type header but is a non-standard extension in Firefox. This workaround is not possible if one uses JavaScript libraries such as jQuery, which themselves rely on XMLHttpRequest.

For a discussion of why Firefox appends the Content-Type header view this bug report on mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=416178.
Comment 1 Martin Balin 2016-07-07 08:56:26 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 2 ctalkobt 2018-02-22 21:07:02 UTC
Confirmed that this issue is still re-occurring in development builds.  Content type is being sent as "application/x-www-form-urlencoded; charset=UTF-8".