Reputation: 6938
I am following this to implement Login-with-twitter, i have changed consumer key and secret key as per the application created by me. i am getting error in the following method :
public string WebResponseGet(HttpWebRequest webRequest)
{
StreamReader responseReader = null;
string responseData = "";
try
{
responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());
responseData = responseReader.ReadToEnd();
}
catch
{
throw;
}
finally
{
webRequest.GetResponse().GetResponseStream().Close();
responseReader.Close();
responseReader = null;
}
return responseData;
}
}
Getting error on "responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream());" line.
The Error is The remote server returned an error: (401) Unauthorized.
please help me to resolve this problem. Thanks in advance.
Upvotes: 0
Views: 370
Reputation: 2087
Your WebRequest must be incorrectly formatted. It needs to comply with oAuth 2. If you want to see how this can be done you can analyze the code of the Token class of Tweetinvi API.
If you are having a problem on a specific query please provide your code so that we can help you.
I am a developer of Tweetinvi so you can ask me any question you want.
Upvotes: 2