Firstly, thank you for such a prompt response. :)
I have been using the Apache Commons libs, and as far as I am aware,
the request is not going through any filters, proxies, or anything
that would or could remove the header.
I'm not sure how to check where the header gets removed, I just
followed the examples on the google code page.
Code:
// create a consumer object and configure it with the access
// token and token secret obtained from the service provider
CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(
Chatbin.API_KEY,
Chatbin.API_SECRET,
SignatureMethod.HMAC_SHA1);
DefaultOAuthProvider provider = new DefaultOAuthProvider
(consumer,
"
http://api.netbin.co.uk/oauth/request_token",
"
http://api.netbin.co.uk/oauth/access_token",
"
http://api.netbin.co.uk/oauth/authorise");
consumer.setTokenWithSecret(key, secret);
// create an HTTP request to a protected resource
HttpGet request = new HttpGet("
http://api.netbin.co.uk/
friends/get");
//HttpGet request = new HttpGet("
http://twitter.com/statuses/
user_timeline/28089893.json"); // twitter request
// sign the request
consumer.sign(request);
// some debug
System.out.println("Headers!:");
for (int i = 0; i < request.getAllHeaders().length; i++)
{
System.out.println(request.getAllHeaders()[i].getName() +
" : " + request.getAllHeaders()[i].getValue());
}
// DefaultHttpClient httpClient = new DefaultHttpClient
(request.getParams());
DefaultHttpClient httpClient = new DefaultHttpClient();
// send the request
HttpResponse response = httpClient.execute(request);
HttpEntity entity = response.getEntity();
entity.writeTo(System.out);
System.out.print("\n");
Hopefully you'll be able to either tell me how to check the networking
stack, or fix my code if I'm doing something obvious wrong. :)