Skip to content

Request cannot send utf_8 charset when the body is not null #4

Closed
@wujie8x8

Description

@wujie8x8

Issue Summary

I try to use the sendgrid template and I set the personalization, but one value like this : "Irène" this is word using utf-8 charset. I have set headers
requestHeaders.put("Content-Type", "application/json; charset=utf-8");
request.headers = requestHeaders;
But the return is : org.apache.http.client.HttpResponseException: Unsupported Media Type

I use sendgrid 2.2.2 is ok.

So I check the client.java and find you set the
content_type : "application/json" when the body is not null.

Steps to Reproduce

Could you check the headers if there exists the content_type, don't set the content-type automatically?
or you tell me how to sovle this problem ?

Thank you.

Technical details:

  • java-http-client Version: master (latest commit: [commit number])
  • Node.js Version: 1.7.0_60

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions