Hi,
The '417- Expectation failed error' occurs again for me while updating
status. I am using the Yedda Twitter library. I have already added
'System.Net.ServicePointManager.Expect100Continue = false;' to my
Posting function:
protected string ExecutePostCommand(string url, string userName,
string password, string data)
{
WebRequest request = WebRequest.Create(url);
if (!string.IsNullOrEmpty(userName) && !
string.IsNullOrEmpty(password))
{
request.Credentials = new NetworkCredential(userName,
password);
request.ContentType = "application/x-www-form-
urlencoded";
request.Method = "POST";
System.Net.ServicePointManager.Expect100Continue =
false;
etc etc.............
I tried changing the position of
'System.Net.ServicePointManager.Expect100Continue = false;' to above
the WebRequest object creation, but that also does n't help.
This occurs in random. Please help me out of this situation as this
has been happening since a week now.
Thanks in advance
On Feb 23, 7:51 pm, ErikAkerfeldt <[email protected]> wrote:
> Hi,
>
> I had some trouble with this. My app were making two webrequests, to
> two different servers.
> The first one never experiences any issues with the 417 error and I
> added 100Cont = false to all my Twitter requestes.
>
> it turned out,
>
> My app needed
> System.Net.ServicePointManager.Expect100Continue = false
> on all webrequests not only those going to Twitter
>
> Then everything is fine. :)
>
> On Jan 7, 8:21 am, Vivek <[email protected]> wrote:
>
> > Hi,
>
> > thanxs for replying, i have tried as per you mention.
>
> > But no success, still getting (417) error.
>
> > Vivek Shrivastav
> > Invitratech India
>
> > On Jan 6, 7:01 pm, "Maxfield Pool" <[email protected]> wrote:
>
> > > Try moving your System.Net.ServicePointManager.Expect100Continue = false
> > > higher in your method before you create your WebRequest object, that
> > > should
> > > help.
>
> > > On Tue, Jan 6, 2009 at 6:49 AM, Vivek <[email protected]> wrote:
>
> > > > Hi,
>
> > > > We are getting same (417) error back in our website.
>
> > > > code:
> > > > public string ExecutePostCommand(string url, string userName, string
> > > > password, string data)
> > > > {
> > > > WebRequest request = WebRequest.Create(url);
> > > > if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty
> > > > (password))
> > > > {
> > > > request.Credentials = new NetworkCredential(userName,
> > > > password);
> > > > request.ContentType = "application/x-www-form-urlencoded";
> > > > request.Method = "POST";
>
> > > > if (!string.IsNullOrEmpty(TwitterClient))
> > > > {
> > > > request.Headers.Add("X-Twitter-Client",
> > > > TwitterClient);
> > > > }
>
> > > > if (!string.IsNullOrEmpty(TwitterClientVersion))
> > > > {
> > > > request.Headers.Add("X-Twitter-Version",
> > > > TwitterClientVersion);
> > > > }
>
> > > > if (!string.IsNullOrEmpty(TwitterClientUrl))
> > > > {
> > > > request.Headers.Add("X-Twitter-URL",
> > > > TwitterClientUrl);
> > > > }
>
> > > > if (!string.IsNullOrEmpty(Source))
> > > > {
> > > > data += "&source=" + HttpUtility.UrlEncode(Source);
> > > > }
>
> > > > byte[] bytes = Encoding.UTF8.GetBytes(data);
>
> > > > request.ContentLength = bytes.Length;
> > > > using (Stream requestStream = request.GetRequestStream())
> > > > {
> > > > requestStream.Write(bytes, 0, bytes.Length);
>
> > > > System.Net.ServicePointManager.Expect100Continue =
> > > > false;
> > > > using (WebResponse response = request.GetResponse())
> > > > {
> > > > using (StreamReader reader = new StreamReader
> > > > (response.GetResponseStream()))
> > > > {
> > > > return reader.ReadToEnd();
> > > > }
> > > > }
> > > > }
> > > > }
>
> > > > return null;
> > > > }
>
> > > > Please help me out,
>
> > > > Thanxs
>
> > > > Vivek Shrivastav
>
> > > > On Jan 2, 1:06 am, Joint Contact <[email protected]> wrote:
> > > > > Thanks for posting this information. We've applied these changes and
> > > > > our application is back to normal.
>
> > > > > Regards;
>
> > > > > -Wayne
>
> > > > > On Dec 23 2008, 8:31 pm, JakeS <[email protected]> wrote:
>
> > > > > > Looks like twitter is updating something and their servers are
> > > > > > returning error 417 for a lot of requests. I looked into it and
> > > > > > found
> > > > > > that .NET automatically includes an Expect header containing "100-
> > > > > > continue" on every request unless you specifically tell it not to.
>
> > > > > > So for any .NET devs having trouble, you can set
> > > > > > System.Net.ServicePointManager.Expect100Continue = false before
> > > > > > making
> > > > > > your request to get past this issue.- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -