问题
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