0
爲了響應我對授權令牌的請求,Soundcloud使用json字符串進行回覆,儘管我要求使用xml。這是一個錯誤,還是未實現,或者我做錯了什麼?Soundcloud使用json而不是xml作爲請求回覆
我已經在下面的「詳細」模式下展示了libcurl的輸出,顯示了「Accept」頭,以及以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, 「範圍」: 「*」, 「refresh_token」: 「50530eb4738f285df48f3694ad49XXXX」}
行..我有它與json的工作,所以這沒關係 – user1313170 2012-05-01 16:54:50