Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using Twitter API, For the purpose of integrate twitter features from my application. I am using Twitterizer2.dll. But the problem is, Not only the Authentication & authorization, all the twitter function returns "page System.Xml.XmlException: Data at the root level is invalid. Line 1".

It is working fine on another system even if copy the same code.

That same code worked fine in past days, but today that returns XML Exception. please any one help me.

I cant find what held. Please let me know how to fix this issue.

code for Authorization Url function :

Example twitter function:

public string GetTwitterAuthorizationUrl(string strConsumerKey, string strConsumerSecret)
{
OAuthTokenResponse reqToken = OAuthUtility.GetRequestToken(strConsumerKey, strConsumerSecret);
return "https://twitter.com/oauth/authorize?oauth_token=" + reqToken.Token;
}
Posted
Updated 28-Feb-12 18:17pm
v2

1 solution

Hi Is you have take SSL for your domain because you authorize token form secure twitter url(https://twitter.com/oauth/authorize?oauth_token=" + reqToken.Token;)
For this u can can check the protocol (
C#
Request.Url.Port) == 443) { http = "https://"; } else { http = "http://";
using c# and
JavaScript
location.protocol
in js) and load the twitter api according.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900