<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi everyone,<br>
    <br>
    I am trying to display OSM data into my web map as well as other
    custom layers.<br>
    One of the goals of my web application is to upload data from my
    application to the osm database.  I have been reading this
    <a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/API_v0.6#Elements">http://wiki.openstreetmap.org/wiki/API_v0.6#Elements</a> but still I do
    not understand how a PUT request functions. I have so much to
    learn....<br>
    <br>
    After authentificating with osmauth.js I try this code without any
    success. I get a 401 error.<br>
    <br>
    var xml_string = '<?xml version="1.0" encoding="UTF-8"?>
    <osm version="0.6" generator="MyOpenstreetmapApp"><node
    changeset="0" lat="41.983910" lon="2.816094"><tag k="shop"
    v="supermarket"/></node></osm>';<br>
    <br>
    ajaxurl= <a class="moz-txt-link-rfc2396E" href="http://www.openstreetmap.org/api/0.6/node/create">"http://www.openstreetmap.org/api/0.6/node/create"</a>;<br>
    <br>
    $.ajax({<br>
        url: ajaxurl,<br>
        data: xml_string, <br>
        type: 'PUT',<br>
        contentType: "text/xml",<br>
        dataType: "text",<br>
        success : function (resp){console.debug(resp)},<br>
        error : function (xhr, ajaxOptions, thrownError){  <br>
            console.log(xhr.status);          <br>
            console.log(thrownError);<br>
        } <br>
    });        <br>
    <br>
    Do I need to include oauth_secret and oauth_consumer_key from the
    authentification proccess in the ajax request?<br>
    <br>
    Any help will be really apreciated.<br>
    Thanks <br>
    <div class="moz-signature">-- <br>
      <span style="font-size:8.5pt">
        <b>Toni Hernández Vallès</b>
        <br>
        Servei de Sistemes d'Informació Geogràfica i Teledetecció<br>
        -<br>
        Universitat de Girona<br>
        <b>SIGTE</b><br>
        -<br>
        Pl. Ferrater Mora 1<br>
        17071 Girona<br>
        Tel +34 972 418 039 (7026 intern)<br>
        <a href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a>
        <br>
        <br>
        <a href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>
        Twitter <a href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a><br>
        <br>
      </span></div>
  </body>
</html>