API webservice testing with Postman

这一生的挚爱 提交于 2019-12-12 02:49:09

问题


I installed Postman inside Chrome to test Kairos API webservice. I have set following fields:

I get error message, but regarding to API documentation it should be working in this format.

Authentication parameters missing


回答1:


On Kairos' website it says:

Requests must be authenticated with your API key. This must be sent as an HTTP header.

So click the "Add token to the header" radio button under "Previously Used" instead of the "Add token to the url" button, and it should work!




回答2:


The API is prompting for your developer APP ID and APP KEY. You are missing these headers in your requests.

Here's an example via Curl:

curl -s -X POST http://api.kairos.com/detect \
-H "content-type: application/json" \
-H "app_id: xxxxxx" \
-H "app_key: xxxxxx"  \
-d '{ "image": "http://media.kairos.com/test1.jpg" }'

Make sure to replace the xxxxxx strings with your developer APP_ID and APP_KEY.

You can register for a free developer account and you can browse the API documentation here.



来源:https://stackoverflow.com/questions/36560247/api-webservice-testing-with-postman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!