Closed
Description
Originally opened as dart-lang/sdk#17405
This issue was originally filed by [email protected]
A Content-Type header is ignored when sending http.post.
If I call http.post with a header "Content-Type", the server doesn't get the value specified if there is also a body. Instead, it always gets "text/plain; charset=utf-8".
If I change the header key to "content-type", everything works as expected.
There are several issues here.
- I would expect the header key to be used case-insensitive.
- Requests set body has as side-effect that the _contentType is set.
This side-effect is documented, however it explicitly mentions "Content-Type". And so does Requests ContentType get \_contentType
.
I've attached two source files to demonstrate the problem.
Attachments:
httpheadersserver.dart (288 Bytes)
httpheadersclient.dart (243 Bytes)
pubspec.yaml (91 Bytes)