OpenStreetMap API

Hi. I try to write an application in .NET using OpenStreetMap API. First I want to download some GPX traces. After reading information about API version 0.6 in http://wiki.openstreetmap.org/wiki/API_v0.6 I try to use GET request

GET /api/0.6/user/gpx_files

But I receive the following exception (Error 401: Unauthorized). In fact, API documentation from wiki contains a sentence “for the authenticated user” for this GET request. How should I do to get authentication in my application? I have my own “Consumer Key”, Consumer Secret" and I know “Request Token URL”, “Access Token URL”, “Authorise URL”.

hi,

you have to send a basic http authentication header with your credentials first.

Regards

Michael

Could you give me a tip how I should send to http? (for example type and template of request)

hi,

must be something like this

HttpWebRequest req …

req.Headers.Add(“Authorization”, "Basic " + username_and_password);

Regards

Michael