Dynamic http-connector header

Correct, what is probably happening is when you are adding your access token something weird is being returned in the response. You need to confirm the exact values that are being returned in your response. The best way to do this is to return as a String (when using the access token) and manually view the response body.

Also take a look at using: Replacing Http-Connector with Jsoup usage
which will give you some more control to test and handle responses.