Hi,
I am trying to connect with twitter from Salesforce.com.
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod(‘POST’);
req.setEndpoint(‘https://api.twitter.com/1/statuses/update.xml’);
req.setHeader(‘Content-Type’,‘application/x-www-form-urlencoded’);
Blob headerValue = Blob.valueOf(‘username:password’);
String authorizationHeader = 'Basic ’ + EncodingUtil.base64Encode(headerValue);
req.setHeader(‘Authorization’, authorizationHeader);
but it throws error to me that basic authentication is not allowed. Please help me to transform it in OAuth request. I don’t know how to do that in salesforce.
Regards