I deployed a web service to WLS 10.3.5 containing code to connect to a remote REST service. It failed to pass JSON to it via POST method even though my Content-Type and Accept HTTP headers are application/json.

I printed out what the HttpURLConnection object contains and the Content-Type is text/html so that's why it failed. When I executed the same code outside of WLS then everything works fine.