web-dev-qa-db-ja.com

Postmanでのトークンキー認証

Postmanで以下のトークンベースの認証呼び出しを行うにはどうすればよいですか?

curl -H "Authorization: ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43" -F "image=/path_to_photo/image.jpg" http://localhost:8000/api/photo/ -v

これは動作しません:

enter image description here

これは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/
< 
17
dan-klasson

そのはず:

ApiKey dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43` 

だけでなく:

dan:ab104c54c6d06fa5bc17e38059c1b814ee9c3b43

Authorizationヘッダー内。

enter image description here

26
Matúš Bartko