[OSM-dev] API - modifying tags?
OJW
streetmap at blibbleblobble.co.uk
Thu Jul 19 23:49:08 BST 2007
Reply to myself here (because I might want to know this stuff in future), it
was the age-old "Expect: 100-continue" problem.
Apparently some HTTP libraries just add this expectation header (with varied
spellings of 'continue') to your PUT headers unless you find a way to
suppress them.
The server responds with "417: Expect failed" (probably before it even reaches
the OSM API, which is why it's not listed in our page of response codes,
although maybe we should put a note about it there)
In CURL (using PHP code here) the way to fix it was:
curl_setopt($ch,CURLOPT_HTTPHEADER, array("Expect:"));
i.e. explicitly set the header to blank
Useful debugging methods for CURL are:
(1) Display the full server response
curl_setopt($ch, CURLOPT_HEADER, true);
(2) Log the verbose output somewhere
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_STDERR, $someFilePointer);
That's HTTP response 417 CURL PHP Expect 100 continue expect failed for the
benefit of search engines indexing this list...
More information about the dev
mailing list