PHP, cURL, and Expect: 100-continue

I’m writing a script which queries the Wikipedia API, and with that I’ve encountered an issue with cURL.

Wikimedia’s servers aparently don’t like the Expect: 100-continue header, and cURL seems to send it by default. Unfortunately, it seems the easiest way to disable it is just to override the header.

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

Thanks to Matt Thommes and Stickman for their posts about this :)