I've posted this on the forum also ( <a href="http://forum.openstreetmap.org/viewtopic.php?id=5594">http://forum.openstreetmap.org/viewtopic.php?id=5594</a> ) but figured I might have better luck asking here.<br><br>---<br>
<br>Hello,<br><br>I wrote a small PHP script to import all the Romanian settlement boundaries and it is working perfectly fine on <a href="http://api06.dev.openstreetmap.org">api06.dev.openstreetmap.org</a>. However when I switched to <a href="http://api.openstreetmap.org">api.openstreetmap.org</a> I keep getting bad request errors.<br>
<br>Here's the code that creates a changeset.<br><br>$server = '<a href="http://api.openstreetmap.org">api.openstreetmap.org</a>';<br><br>$put_file = fopen('tmp/tmpfile', 'w+');<br>fwrite($put_file, $create_changeset_data);<br>
rewind($put_file);<br>    <br>$ch = curl_init();<br>curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'/api/0.6/changeset/create');<br>curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br>curl_setopt($ch, CURLOPT_HEADER, true);<br>
curl_setopt($ch, CURLOPT_PUT, true);<br>curl_setopt($ch, CURLOPT_INFILE, $put_file);<br>curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password);<br>$changeset_id = curl_exec($ch);<br>curl_close($ch);    <br>fclose($put_file);<br>
<br>In $create_changeset_data I have the following:<br><br><osm><br>    <changeset><br>        <tag k="created_by" v="Romanian Settlement Boundaries v0.1"/><br>        <tag k="comment" v="Boundaries for Bicaz / Source: Mircea Angelescu (<a href="http://cultura.ro">cultura.ro</a>)"/><br>
    </changeset><br></osm><br><br>The provided user / password combination works and I can write tmp/tmpfile.<br><br>The error I'm getting (including headers) is here:<br><a href="http://pastebin.com/m40669009">http://pastebin.com/m40669009</a><br>
<br>As I said, if I change $server to <a href="http://api06.dev.openstreetmap.org">api06.dev.openstreetmap.org</a> it works fine. I don't get it, isn't the sandbox supposed to be exactly the same as the main API? What's the use of it if it's not? :(<br>
<br>Regards,<br>Janos<br>