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

Added escape characters to the Content-Type header and Accept header when sending JSON Post - Version 1.4.9 #1147

Open
lucasantarella opened this issue Apr 9, 2016 · 1 comment

Comments

@lucasantarella
Copy link

Hello,

My API requires that a POST request specify 1 of 2 content types: application/json or application/xml.

When performing a request, I add the accept header like so:

public void setupHttpClient() {
    httpClient.addHeader("Accept", "application/json");
    httpClient.addHeader("Content-Type", "application/json");
    httpClient.addHeader("User-Agent", generateUserAgentString());
}

However, when examining the resulting response from my API, I notice that the headers being sent have an escape slash, i.e.

"application\/json"

instead of

"application/json"

This is extremely annoying, and I can't figure out why my header is being escaped. My API is denying every request because it does not match the required header. Please assist in resolving this issue.

If needed, I can supply a full JSON output from my API with the understood request headers for clarification.

@lucasantarella lucasantarella changed the title Added escape characters to the Content-Type header and Accept header when sending JSON Post Added escape characters to the Content-Type header and Accept header when sending JSON Post - Version 1.4.9 Apr 9, 2016
@lucasantarella
Copy link
Author

@loopj Can you please assist with this issue ASAP? My boss is going to kill me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant