title: api to create a new page on confluence
body: <p>I am a member of a confluence group which I open from browser from the following URL</p>
  
  <pre><code>https://kensci.atlassian.net/wiki/collector/pages.action?key=MyKyey
  </code></pre>
  
  <p>Hitting this page gives me the login page, where I enter my credentials and go about creating a new page etc.</p>
  
  <p>I would like to do this from an API. I have read several posts on the internet and feel that this below curl command should work.</p>
  
  <pre><code>curl -v -u admin:admin -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d'{"type":"page","title":"new page","space":{"key":"ATTACH"},"body":{"storage":{"value":"&lt;p&gt;This is a new page&lt;/p&gt;","representation":"storage"}}}' "http://localhost:8090/rest/api/content/?os_authType=basic"
  </code></pre>
  
  <p>However, what do I replace the URL <a href="http://localhost:8090/rest/api/content/?os_authType=basic" rel="nofollow">http://localhost:8090/rest/api/content/?os_authType=basic</a> with? Do I replace it with the URL I open from my browser which is <a href="https://kensci.atlassian.net/wiki/collector/pages.action?key=MyKey/?os_authType=basic" rel="nofollow">https://kensci.atlassian.net/wiki/collector/pages.action?key=MyKey/?os_authType=basic</a></p>
  
  <p>I have tried this, so finally string looks as follows</p>
  
  <pre><code>curl -v -u myusername:mypassword -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d'{"type":"page","title":"new page","space":{"key":"ATTACH"},"body":{"storage":{"value":"&lt;p&gt;This is a new page&lt;/p&gt;","representation":"storage"}}}' "https://kensci.atlassian.net/wiki/collector/pages.action?key=MyKey/?os_authType=basic"
  </code></pre>
  
  <p>But it does not create a page, and just spits out a huge amount of HTML.</p>