Site icon The _khAttAm_ Blog

[SOLVED] “417 – Expectation Failed” in PHP curl while submitting multi-part forms

I am using PHP Curl extension for a project which requires uploading file to a server I had no control over. However, I was getting HTTP Status 417 with error message Expectation Failed. I don’t know what this is supposed to do and why curl sends it, so I tried removing it by overriding it with the following code:

curl_setopt($curl,CURLOPT_HTTPHEADER,array("Expect:  "));

It worked and the file uploaded successfully.

Hope this helps.

Exit mobile version