Can't create document with POST request

As per documentation I’m trying to crate a document on sever via ync gateway REST interface using POST verb. This is my request:

curl -X POST -u user:password -H "Content-type: application/json" -d @TestStep.json 'http://myserver.com:4985/task'

and this is my json in TestStep.json file:

{ "completed": false, "created_at": "2016-03-27T10:00:00.000Z", "description": "blabla", "taskid": "testStepNew", "owner": "user", "parent_id": "1234", "task_type": -3, "title": "bla", "order_pos": 1000 }

The request end with no response form server and object is not created. The same command line with PUT verb and new object ID specified in the URL works.

Can anyone help me addressing this issue? Is there something wrong in my call?

Thanks.

Paolo

  1. you should follow this documentation;
  2. you should use this command: curl -X POST -u user:password -H "Content-type: application/json" -d @TestStep.json 'http://myserver.com:4985/task/'
  3. The default admin port is 4985,If you use admin port, you should run the curl on the Sync Gateway server,and any user/password can work;
  4. may be you should use Sync Gateway port(defaule is 4984) with username and password;