I have the following cURL request:
curl -H "AuthToken: anything" http://localhost:9999/my_service/data?%24expand=total%2Callocated
I'd like to use Apache HttpClient to make this call in my application. My code is as follows:
HttpGet httpGet = new HttpGet(uri);
httpGet.setConfig(myConfig);
httpGet.addHeader("-H", "AuthToken: anything");
response = this.httpClient.execute(httpGet, httpClientContext);
However, this does not work - i get a response code 400.
What am i missing here? Any help would be greatly appreciated!