Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332259 - [Browser] Post requests always uses application/x-www-form-urlencoded content-type
Summary: [Browser] Post requests always uses application/x-www-form-urlencoded content...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 452090 452091 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-09 17:42 EST by Ian Bull CLA
Modified: 2014-12-17 10:03 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Bull CLA 2010-12-09 17:42:43 EST
I am trying to use the SWT browser to talk to a webserver that is expecting application/json content. However, when I 'post' data (using the browser API setURL(String, String, String[])) method, it *always* sets my content-type to application/x-www-form-urlencoded.  Even if I specify a different content-type in the headers field, it gets replaced with application/x-www-form-urlencoded.

This is happening in both Mozilla and Webkit (on Linux/GTK), I don't know about other platforms. It appears that both browser implementations will always set this field regardless of what other headers are set.

Maybe we can check if these fields are already set, and use the existing values if so.  (This appears to be the same for content-length too, although that's likely not as serious).
Comment 1 Grant Gayed CLA 2011-10-17 15:39:38 EDT
Fixed > 20111017, patch: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=016dc8e9d43c2ce1a2b2df6c6d7ccc20e421936e .  The Mozilla and WebKitGTK implementations were the only ones that needed changes.
Comment 2 EPP Error Reports CLA 2014-11-18 08:12:09 EST
*** Bug 452090 has been marked as a duplicate of this bug. ***
Comment 3 EPP Error Reports CLA 2014-11-18 08:12:10 EST
*** Bug 452091 has been marked as a duplicate of this bug. ***
Comment 4 EPP Error Reports CLA 2014-12-15 11:47:54 EST
To date this log entry was reported 10 times.

Your friendly error reports bot.
Comment 5 EPP Error Reports CLA 2014-12-16 13:03:18 EST
To date this log entry was reported 25 times.

Your friendly error reports bot.
Comment 6 EPP Error Reports CLA 2014-12-17 10:03:59 EST
To date this log entry was reported 50 times.

Your friendly error reports bot.