Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Expect Header Issue for .NET developers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  17 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
JakeS  
View profile  
 More options Dec 23 2008, 11:31 pm
From: JakeS <jakesteven...@gmail.com>
Date: Tue, 23 Dec 2008 20:31:27 -0800 (PST)
Local: Tues, Dec 23 2008 11:31 pm
Subject: Expect Header Issue for .NET developers
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.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Payne  
View profile  
 More options Dec 23 2008, 11:35 pm
From: "Alex Payne" <a...@twitter.com>
Date: Tue, 23 Dec 2008 20:35:06 -0800
Local: Tues, Dec 23 2008 11:35 pm
Subject: Re: Expect Header Issue for .NET developers
Thanks for helping out with this tip, Jake.

On Tue, Dec 23, 2008 at 20:31, JakeS <jakesteven...@gmail.com> 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.

--
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rhysmeister  
View profile  
 More options Dec 24 2008, 11:03 am
From: rhysmeister <therhysmeis...@hotmail.com>
Date: Wed, 24 Dec 2008 08:03:36 -0800 (PST)
Local: Wed, Dec 24 2008 11:03 am
Subject: Re: Expect Header Issue for .NET developers
Thanks for the tip.

Is this a permanent change?

I'm days away from releasing an app so I will need to do a new build
if this is the case.

Rhys

On Dec 24, 4:31 am, JakeS <jakesteven...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos  
View profile  
 More options Dec 24 2008, 11:24 am
From: Carlos <carlosju...@gmail.com>
Date: Wed, 24 Dec 2008 08:24:56 -0800 (PST)
Local: Wed, Dec 24 2008 11:24 am
Subject: Re: Expect Header Issue for .NET developers
Thanks Jake, I was getting the same errors.

Is this expected behavior now for Twitter or is this a bug in the new
Twitter release (Not supporting the Expect: Continue header). I'm
writing a multi-service Windows Mobile application and I'd prefer not
changing global http connection settings if I don't have to.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cameron Kaiser  
View profile  
 More options Dec 24 2008, 11:35 am
From: Cameron Kaiser <spec...@floodgap.com>
Date: Wed, 24 Dec 2008 08:35:19 -0800 (PST)
Local: Wed, Dec 24 2008 11:35 am
Subject: Re: Expect Header Issue for .NET developers

> Is this expected behavior now for Twitter or is this a bug in the new
> Twitter release (Not supporting the Expect: Continue header). I'm
> writing a multi-service Windows Mobile application and I'd prefer not
> changing global http connection settings if I don't have to.

Strictly speaking, according to the HTTP spec, it was a bug to *accept*
Expect 100-continue and *not* return a 417 if you weren't prepared to handle
it. See RFC 2616, 14.20. Thus, Twitter's Apache was buggy *before*, but not
now.

There are arguments for shooting first and asking questions later (i.e.,
send Expect: headers all the time even if the remote server doesn't handle
it right), but clients that shoot first should be prepared to retry the
request without Expect: because there are still many servers that don't
know what to do with it. There are also ambiguous situations with servers
that don't understand the header at all and just ignore it; see Section
8.2.3.

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
  Cameron Kaiser * Floodgap Systems * www.floodgap.com * ckai...@floodgap.com
-- Ninety-nine percent of lawyers give the rest a bad name. -------------------


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Morris  
View profile  
 More options Dec 24 2008, 2:57 pm
From: Tom Morris <t...@tommorris.org>
Date: Wed, 24 Dec 2008 11:57:49 -0800 (PST)
Local: Wed, Dec 24 2008 2:57 pm
Subject: Re: Expect Header Issue for .NET developers
On Dec 24, 4:31 am, JakeS <jakesteven...@gmail.com> 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.

A lot of libraries follow this behaviour. A Twitter app I wrote in PHP
a while back has been logging 417s most of today. I logged in and
added:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

Other libcurl-based libraries may be affected. There are plenty of
reports about 417 and Expect on the cURL website - http://curl.haxx.se/
- and on the websites of particular language bindings.

--
Tom Morris (@tommorris)
<http://tommorris.org>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dean.j.robinson  
View profile  
 More options Dec 24 2008, 6:50 pm
From: "dean.j.robinson" <Dean.J.Robin...@gmail.com>
Date: Wed, 24 Dec 2008 15:50:12 -0800 (PST)
Local: Wed, Dec 24 2008 6:50 pm
Subject: Re: Expect Header Issue for .NET developers
Started getting reports from users yesterday that they couldn't login
to hahlo.com.

Turns out that the check I run against "verify credentials" was also
returning code 417 instead of the usual/expected 200, so even though
the check was working to hahlo is looked like it was failing, changed
my check to include code 417 and now its working again.

Strangely though, a local dev copy of Hahlo 4, which also checks
"verify credentials" and also only expects a 200 response, is still
working fine..,

On Dec 25, 6:57 am, Tom Morris <t...@tommorris.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Carlyon  
View profile  
 More options Dec 24 2008, 7:13 pm
From: Barry Carlyon <barrycarl...@gmail.com>
Date: Thu, 25 Dec 2008 00:13:31 +0000
Local: Wed, Dec 24 2008 7:13 pm
Subject: Re: Expect Header Issue for .NET developers
I'm currently getting 417 as well on my php from script using curl

Sent from my iPhone

On 24 Dec 2008, at 23:50, "dean.j.robinson"  


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PockeTwitDev  
View profile  
 More options Dec 24 2008, 4:31 pm
From: PockeTwitDev <pocketwit...@gmail.com>
Date: Wed, 24 Dec 2008 13:31:27 -0800 (PST)
Local: Wed, Dec 24 2008 4:31 pm
Subject: Re: Expect Header Issue for .NET developers
After investigating further it appears this only occurs for .NET
applications which post using form data instead of using URL
parameters.  Here's a sample:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Credentials = new NetworkCredential(AccountInfo.UserName,
AccountInfo.Password);
request.PreAuthenticate = true;
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String
(Encoding.ASCII.GetBytes(AccountInfo.UserName + ":" +
AccountInfo.Password)));
byte[] bytes = Encoding.UTF8.GetBytes(data); //Data is what's being
posted
request.ContentLength = bytes.Length;
System.Net.ServicePointManager.Expect100Continue = false;   //NEED
THIS NOW TO FIX ERROR 417
using (Stream requestStream = request.GetRequestStream())
{
    requestStream.Write(bytes, 0, bytes.Length);
    requestStream.Flush();

}

 using (HttpWebResponse response = (HttpWebResponse)request.GetResponse
())
{
    using (StreamReader reader = new StreamReader
(response.GetResponseStream()))
    {
        return reader.ReadToEnd();
    }

}

I don't doubt that it's a bug in the development platforms, but even
so it's a pretty common one.  It doesn't appear to happen to those
apps which just URLEncode the data and include it in the URL, but I
don't think that's exactly proper specification either :)

On Dec 24, 1:57 pm, Tom Morris <t...@tommorris.org> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
weiran  
View profile  
 More options Dec 25 2008, 5:21 pm
From: weiran <weir...@gmail.com>
Date: Thu, 25 Dec 2008 14:21:14 -0800 (PST)
Local: Thurs, Dec 25 2008 5:21 pm
Subject: Re: Expect Header Issue for .NET developers
Setting

> System.Net.ServicePointManager.Expect100Continue = false;

Doesn't work for me, I still get 417 errors?

On Dec 24, 9:31 pm, PockeTwitDev <pocketwit...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lpina@colada.com  
View profile  
 More options Dec 26 2008, 4:57 pm
From: "lp...@colada.com" <lp...@colada.com>
Date: Fri, 26 Dec 2008 13:57:47 -0800 (PST)
Local: Fri, Dec 26 2008 4:57 pm
Subject: Re: Expect Header Issue for .NET developers
From the doc on MSDN "Changing the value of this property does not
affect existing ServicePoint objects. Only new ServicePoint objects
created after the change are affected. "

Make sure the statement
System.Net.ServicePointManager.Expect100Continue = false; is called in
the service contrutor and you should be fine.

On Dec 25, 2:21 pm, weiran <weir...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joint Contact  
View profile  
 More options Jan 1, 3:06 pm
From: Joint Contact <i...@arbutusinc.com>
Date: Thu, 1 Jan 2009 12:06:06 -0800 (PST)
Local: Thurs, Jan 1 2009 3:06 pm
Subject: Re: Expect Header Issue for .NET developers
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 <jakesteven...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vivek  
View profile  
 More options Jan 6, 7:49 am
From: Vivek <vivek.shrivas...@gmail.com>
Date: Tue, 6 Jan 2009 04:49:15 -0800 (PST)
Local: Tues, Jan 6 2009 7:49 am
Subject: Re: Expect Header Issue for .NET developers
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 <i...@arbutusinc.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maxfield Pool  
View profile  
 More options Jan 6, 9:01 am
From: "Maxfield Pool" <maxfield.p...@gmail.com>
Date: Tue, 6 Jan 2009 08:01:32 -0600
Local: Tues, Jan 6 2009 9:01 am
Subject: Re: Expect Header Issue for .NET developers

Try moving your System.Net.ServicePointManager.Expect100Continue = false
higher in your method before you create your WebRequest object, that should
help.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vivek  
View profile  
 More options Jan 7, 8:21 am
From: Vivek <vivek.shrivas...@gmail.com>
Date: Wed, 7 Jan 2009 05:21:52 -0800 (PST)
Local: Wed, Jan 7 2009 8:21 am
Subject: Re: Expect Header Issue for .NET developers
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" <maxfield.p...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ErikAkerfeldt  
View profile  
 More options Feb 23, 9:51 am
From: ErikAkerfeldt <erik...@gmail.com>
Date: Mon, 23 Feb 2009 06:51:27 -0800 (PST)
Local: Mon, Feb 23 2009 9:51 am
Subject: Re: Expect Header Issue for .NET developers
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 <vivek.shrivas...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sttester  
View profile  
 More options Apr 23, 1:36 am
From: sttester <stteste...@gmail.com>
Date: Wed, 22 Apr 2009 22:36:15 -0700 (PDT)
Local: Thurs, Apr 23 2009 1:36 am
Subject: Re: Expect Header Issue for .NET developers
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 <erik...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google