我用c語言寫了一段代碼,send了下面內容,想取得百度device的授權。
openapi.baidu.com
hostname:developer.n.shifen.com
hostip:111.202.114.136
socket connect ok
send:GET /oauth/2.0/device/code?client_id=nou9TtG7BHW7KKEGxU6ykrPXpjHQyEA6&response_type=device_code HTTP/1.1
Host: openapi.baidu.com
Accept: image/gif,image/jpeg,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0)
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Connection: close
Cookie: BAIDUID=89CA69B3E3C434728CEF9DDF38E93362:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2145916555; path=/; domain=.baidu.com; version=1
client_id=nou9TtG7BHW7KKEGxU6ykrPXpjHQyEA6&response_type=device_code
回傳結果如下:
read:266
headlen:266
READ:HTTP/1.1 302 Found
Content-Type: text/html
Date: Thu, 14 Sep 2017 01:44:51 GMT
Location: https://openapi.baidu.com/oauth/2.0/device/code?client_id=nou9TtG7BHW7KKEGxU6ykrPXpjHQyEA6&response_type=device_code
Server: Apache
Content-Length: 0
Connection: close
請問各位,我哪里寫錯了?謝謝
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/111102.html
標籤:網絡協議與配置
上一篇:圖形化編程教學實體
