Wednesday, May 29, 2019

HttpClient: How to Remove Charset From Content-Type Header

I was writing a client library for one online service and faced a situation where I had to remove the charset definition from the Content-Type header. It was like the content type was an application/json or the response was a 415 "Unsupported media type." I was using the HttpClient class to communicate with the service and without any additional effort charset doesn't go away. Here is how I got the charset definition away from the Content-Type header.

Problem

My problematic code was similar to the code shown here.



from DZone.com Feed http://bit.ly/2I4p9FX

No comments:

Post a Comment