while sending http request to twitter , it gives this error
Twitter.TwitterApiException: Status: 500 Internal Server Error Content-Type: text/html
500 Internal Server Error
my request format is
string LogedInUser;
LogedInUser=Userinfo.getuserId();
Twitter.Share s = new Twitter.Share();
Twitter link= new Twitter(LogedInUser);
s.text= 'Job vacancy';
s.related='TestJob';
s.url='www.google.com';
link.updateUserShare(s);
my share class is
public class Share
{
public String text{get;set;}
public String related{get;set;}
public String url{get;set;}
public Share()
{ }
public DOM.Document toXML()
{
DOM.Document doc = new DOM.Document();
Dom.XmlNode req=doc.createRootElement('tweet', null, null);
if (text!= null || related!= null || url != null)
{
Dom.XmlNode body;
body= req.addChildElement('text', null, null).addTextNode(text);
body= req.addChildElement('related', null, null).addTextNode((related != null)?related:'');
body= req.addChildElement('url', null, '').addTextNode((url != null)?url:'');
}
return doc;
}
}
I want twitter status should be updated with the given text and url. i m using beta 1.0 sfdc-OAuth Playground package.
I think there is a problem in toXML() method, please look into it.
Thanks!
Asia Naseer.