Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:21:40+00:00 2026-05-15T02:21:40+00:00

I have a custom Http Handler which manipulates HTTP POST and GET. I got

  • 0

I have a custom Http Handler which manipulates HTTP POST and GET. I got the project working on a seperate isolated server now need to put it in production…

using (var client = new WebClient())
                {
                    client.Credentials = CredentialCache.DefaultCredentials;
                    client.UploadFile("serverlocation:port", fileToUpload);
                }

For some reason now when using client.UploadFile("", file); i.e. forcing the HTTP POST

System.Net.WebException: The remote server returned an error: (417) Expectation failed.

   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)

What could this be? I know the code works, so what else? Maybe the server blocks HTTP POST requests?

I have tried adding:

ServicePointManager.Expect100Continue = false;

But have had no success though i’m not 100% sure where this code should before, I assume before i’m using the WebClient


Edit 0 :

I have just read the following:

Because of the presence of older implementations, the protocol allows
ambiguous situations in which a client may send “Expect: 100-
continue” without receiving either a 417 (Expectation Failed) status
or a 100 (Continue) status. Therefore, when a client sends this
header field to an origin server (possibly via a proxy) from which it
has never seen a 100 (Continue) status, the client SHOULD NOT wait
for an indefinite period before sending the request body.

I believe this request is going through a proxy, which may have something to do with the issue.

Edit 1:

Believe this problem has to be with 100-continue because, using fiddler to see exactly what my application is sending with WebClient.UploadFile shows this:

POST http://XXX.XXX.XXX.XXX:8091/file.myhandledextension HTTP/1.1
Content-Type: multipart/form-data; boundary=---------------------8ccd1eb03f78bc2
Host: XXX.XXX.XXX.XXX:8091
Content-Length: 4492
Expect: 100-continue

Despite having put that line: ServicePointManager.Expect100Continue = false; before the using statement. I don’t think this line actually works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:21:41+00:00Added an answer on May 15, 2026 at 2:21 am

    I ended up solving this by putting the ServicePointManager.Expect100Continue = false; in the constructor for the calling WebClient class.

    Then I used Fiddler to examine the POST request to ensure Expect: 100-continue was not in the request anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 448k
  • Answers 448k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can publish an app with your desired java package… May 15, 2026 at 7:48 pm
  • Editorial Team
    Editorial Team added an answer Use: SELECT f.* FROM FRUITS f JOIN (SELECT t.type, MIN(t.price)… May 15, 2026 at 7:48 pm
  • Editorial Team
    Editorial Team added an answer Heroku is really easy. When you're ready for a traffic… May 15, 2026 at 7:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.