百度api device授权302
我用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
请问各位,我哪里写错了?谢谢