How to post json document into bucket using N1QL REST API in Couchbase
<p>I am trying create document in an existing bucket in CouchBase using N1QL query. I am using soapUI to send request to localhost CouchBase server.
I used this link to gain knowledge
<a href="http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-rest-api/index.html" rel="nofollow noreferrer">http://developer.couchbase.com/documentation/server/4.5/n1ql/n1ql-rest-api/index.html</a></p>

<pre><code>N1QL:
GET http://localhost:8093/query/service?statement = ?select * from beer use keys ["beername::abcc"] 
</code></pre>

<p>this works well to fetch doc</p>

<p>How can I do the same to post json data, creating new document.</p>

<p>I tried:</p>

<pre><code>POST http://localhost:8093/query/service. 
</code></pre>

<p>In request body</p>

<pre><code>INSERT INTO `beer` ( KEY, VALUE ) 
VALUES 
 ( 
"k001", 
{ "id": "01", "type": "airline"} 
 ) 
RETURNING META().id as docid, *;
</code></pre>

<p>I am getting</p>

<blockquote>
  <p>"Error processing json request"</p>
</blockquote>