I try to use Postman to learn/test Couchbase.
One action I try to do is to execute a n1ql statement.
When I do it with curl with the following command, I have success
curl http://localhost:8093/query/service -d 'statement=SELECT * FROM myBucket WHERE name="test1"&creds=[{"user":"Administrator","pass":"password"}]'
When I try to do the same on Postman, it fails with Bad Request (400). Copying the postman curl code to the following:
curl -X GET
http://localhost:8093/query/service
-H ‘Content-Type: application/x-www-form-urlencoded’
-H ‘Postman-Token: 5dfeb820-6fee-489d-bd85-8c397f420a54’
-H ‘cache-control: no-cache’
-d ‘statement=SELECT%20*%20FROM%20myBucket%20WHERE%20name%3D%22test1%22&creds=%5B%7B%22user%22%3A%22Administrator%22%2C%22pass%22%3A%22password%22%7D%5D’
Error:
“errors”: [
{
“code”: 1050,
“msg”: “No statement or prepared value”
}
],
Removing “-X GET”, then it works
curl
http://localhost:8093/query/service
-H ‘Content-Type: application/x-www-form-urlencoded’
-H ‘Postman-Token: 5dfeb820-6fee-489d-bd85-8c397f420a54’
-H ‘cache-control: no-cache’
-d ‘statement=SELECT%20*%20FROM%20myBucket%20WHERE%20name%3D%22test1%22&creds=%5B%7B%22user%22%3A%22Administrator%22%2C%22pass%22%3A%22password%22%7D%5D’
Is it normal that Couchbase REST API doesn’t recognize the “-X” parameter ?
I have not yet a clue if I can force postman to not add this parameter.
Thanks