0

为响应我对授权令牌的请求,Soundcloud 回复了一个 json 字符串,尽管我要求的是 xml。这是一个错误,还是未实现,还是我做错了什么?

我在下面以“详细”模式发布了 libcurl 的输出,显示了“接受”标头,以及以 json 格式返回的字符串。

> POST /oauth2/token HTTP/1.1
User-Agent: libcurl-agent/1.0
Host: api.soundcloud.com
Accept: application/xml
Content-Length: 641
Content-Type: multipart/form-data; boundary=----------------------------6d7e62ba13e0

< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 10 Apr 2012 21:48:55 GMT
< Content-Type: application/json; charset=utf-8
< Connection: keep-alive
< X-Runtime: 44
< ETag: "62f76a251f0cdc7c41edec20560d2c04"
< Cache-Control: private, max-age=0, must-revalidate
< Access-Control-Allow-Methods: GET, PUT, POST, DELETE
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
< Access-Control-Allow-Origin: *
< X-Cacheable: NO:Cache-Control=max-age=0
< Content-Length: 133
< X-Varnish: 3363129842
< Age: 0
< Via: 1.1 varnish
< X-Cache: MISS
< 
* Connection #0 to host api.soundcloud.com left intact

Soundcloud 结果:{"access_token":"1-17690-10631-cea7e4319d85f1XXXX","expires_in":21599,"scope":"*","re​​fresh_token":"50530eb4738f285df48f3694ad49XXX​​X"}

4

1 回答 1

0

感谢您指出了这一点。目前,OAuth2 令牌端点支持 on JSON,这与 API 的其余部分不一致。我会提交一个错误,希望我们能解决这个问题。不过你没有做错任何事:-)

于 2012-04-20T15:46:32.240 回答