如何在 Postman 中进行以下基于令牌的身份验证调用?
curl -H "Authorization: ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43" -F "image=/path_to_photo/image.jpg" http://localhost:8000/api/photo/ -v
这不起作用:
这是curl
调用的输出:
dan@dan-iMac:~/app$ curl -H "Authorization: ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43" -F "image=/path_to_photo/image.jpg" http://localhost:8000/api/photo/ -v
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /api/photo/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8000
> Accept: */*
> Authorization: ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43
> Content-Length: 164
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------bbe8b5cf6a427342
>
* Done waiting for 100-continue
* HTTP 1.0, assume close after body
< HTTP/1.0 201 CREATED
< Date: Sat, 08 Nov 2014 04:57:18 GMT
< Server: WSGIServer/0.1 Python/2.7.6
< Vary: Accept
< X-Frame-Options: SAMEORIGIN
< Content-Type: text/html; charset=utf-8
< Location: http://localhost:8000/api/photo/7/
<