[OSM-dev] oAuth PUT not working

Stephan Knauss osm at stephans-server.de
Sun Jan 15 19:26:50 GMT 2012


for the archive...

On 15.01.2012 18:39, Stephan Knauss wrote:
I sniffed JOSM communication to spot any difference in the oauth setup. 
To my surprise there was no difference, still my requests failed with 401.

So I compared other headers as well. It happened that I did not declare 
any content type, so it ended up as application/x-www-form-urlencoded

> This fails:
> PUT /api/0.6/changeset/create HTTP/1.1
> Content-Type: application/x-www-form-urlencoded
> [headers_recv] =>
> HTTP/1.1 401 Authorization Required

As the data is actually xml I changed it to Content-Type: text/xml
And surprise: The server now accepts my edits again.

But why did it respond with "401 Authorization Required"? I guess there 
are other http status codes more appropriate. Why not "400 Bad Request"?


More information about the dev mailing list