Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported Media Type if subject has letters with accent (like 'é' ) #120

Closed
wendellrios opened this issue Jul 15, 2016 · 10 comments
Closed
Labels
status: help wanted requesting help from the community type: bug bug in the library

Comments

@wendellrios
Copy link

Issue Summary

Receiving exception:
org.apache.http.client.HttpResponseException: Unsupported Media Type

If mail subject contains letters with accent (like 'é')

Steps to Reproduce

  1. Copy the sample code available in github and set parameters
  2. Specify subject = é
  3. Run the code -> Exception is thrown, nothing is sent

Technical details:

sendgrid-java-3.0.3-jar.jar
openjdk Runtime IcedTea 2.6.4
Ubuntu 15.10 64 bits

@jpockels
Copy link

jpockels commented Jul 17, 2016

I'm in the same boat.

To add to the issue, the problem doesn't seem to be limited to the Subject, but to the entire body of the request. A special characters in substitution tags will trigger the exception in my end.

I was looking for a way to access the Client and change the StringEntity to UTF-8 as previous solutions suggests for the API version 2.3.1 fix of this issue (sendgrid/java-http-client#4), but I could not find a way to access or re-initialize it.

Has anyone found a temporal fix?

@thinkingserious
Copy link
Contributor

@thinkingserious thinkingserious added type: bug bug in the library status: help wanted requesting help from the community labels Jul 18, 2016
@jpockels
Copy link

jpockels commented Jul 18, 2016

@thinkingserious

I've been using the built jar file from the Readme (http://repo1.maven.org/maven2/com/sendgrid/sendgrid-java/3.0.3/sendgrid-java-3.0.3-jar.jar). If I am correct, It looks like this jar is outdated and does not has the update that fixes the issue.

@thinkingserious
Copy link
Contributor

Thanks for the update @jpockels,

That should be the latest code with the right dependency: https://github.com/sendgrid/sendgrid-java/blob/master/build.gradle#L48

There must be an issue with the packaging. I'm going to leave this ticket open as a bug for further investigation.

Meanwhile, here is a fresh build: sendgrid-3.0.3-jar.jar.zip

@wendellrios
Copy link
Author

@thinkingserious @jpockels thanks! I'm in a hurry right now but will test updated jar later.

@jpockels
Copy link

jpockels commented Jul 18, 2016

@thinkingserious

Tested the build you provided in your last comment, but the issue persists.

The checksums are the exact same for both jars too (Readme linked Jar and your new fresh build) .

@thinkingserious
Copy link
Contributor

@jpockels,

Thanks for the confirmation, there must be some issue with the build process. I'll have to dig deeper.

thinkingserious added a commit that referenced this issue Jul 19, 2016
Updated java-http-client dependency to fix #120
@thinkingserious
Copy link
Contributor

@wendellrios @jpockels,

Thanks for your patience on this.

When the upload to Maven is finally confirmed, this link will contain the fat jar: http://repo1.maven.org/maven2/com/sendgrid/sendgrid-java/3.0.4/sendgrid-java-3.0.4-jar.jar

@jpockels
Copy link

Thank you very much @thinkingserious. I'll be testing again and will let you know.

@thinkingserious
Copy link
Contributor

Upload to Maven complete. I tested it on my side and it looks great. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

3 participants