Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This fails:

$ curl --trace multipart-fail.log -F "source={}"

With a squid status 417 error, ERR_INVALID_REQ.

I've never had this in practice through a web browser, so it's probably curl usage instead of squid, but if I tell curl not to use the squid proxy, the web application on the other end accepts it just fine.

(If there's a more appropriate StackExchange site for this, please let me know.)

share|improve this question

migrated from Jan 30 '10 at 7:44

This question came from our site for computer enthusiasts and power users.

Should probably go on ServerFault. – Josh K Jan 29 '10 at 20:43
up vote 4 down vote accepted

Squid doesn't support Expect: 100-continue, being a HTTP/1.0 device. Notice the response status code 417 Expectation failed.

Curl should retry the request automatically, but it doesn't; instead, you need to suppress the Expect header; e.g.,

curl -H "Expect:" --trace multipart-fail.log -F "source={}"
share|improve this answer

Alternatively you can configure Squid to simply ignore that request header...

Add in squid.conf: ignore_expect_100 on

share|improve this answer

For anyone who stumbles across this question and is getting the same problem with cURL in PHP (not the command line), try adding this line:

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

It worked for me.

share|improve this answer

After a long time I fixed this issue in the following manner..

//proxy server address
//Proxy server port

     curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
     curl_setopt($ch, CURLOPT_PROXY, "$proxyServer:$proxyPort");


Hope this helps someone...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.