Skip to content

http headers Content-Type problems #15

Closed
@DartBot

Description

@DartBot

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.

  1. I would expect the header key to be used case-insensitive.
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing reporttype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions