curl -k -L -d "client_id=&response_type=device_code&scope=basic,netdisk" "https://openapi.baidu.com/oauth/2.0/device/code"
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"device_code":"2044c7d4013744b821ad9a1e0492b9f2",
"user_code":"6udzte26",
"verification_url":"https:\/\/openapi.baidu.com\/oauth\/2.0\/device",
"qrcode_url":"http:\/\/openapi.baidu.com\/device\/qrcode\/6c6a8afee394f99e55eb25858\/2c885vjk",
"expires_in":1800,
"interval":5
}
curl -k -L -d "grant_type=device_token&code=&client_id=&client_secret=" "https://openapi.baidu.com/oauth/2.0/token"
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
{
"access_token": "1.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328",
"expires_in": 86400,
"refresh_token": "2.385d55f8615fdfd9edb7c4b5ebdc3e39.604800.1293440400-2346678-124328",
"scope": "basic email",
"session_key": "ANXxSNjwQDugf8615OnqeikRMu2bKaXCdlLxn",
"session_secret": "248APxvxjCZ0VEC43EYrvxqaK4oZExMB",
}
[beyes@groad baidu_pan]$ curl -k -L "https://pcs.baidu.com/rest/2.0/pcs/quota?method=info&access_token=3.9843a82ece6459badf07bb5b93ee358a.2592000.1386148691.1629633624-1651105"
{"quota":3637078130688,"used":404325764959,"request_id":2584381413}
[beyes@groad baidu_pan]$ curl -k -L -F "file=@tmp.cc" "https://c.pcs.baidu.com/rest/2.0/pcs/file?method=upload&access_token=3.9843a82ece6459badf07bb5b93ee358a.2592000.1386148691.1629633624-1651105&path=/apps/BDP/tmp.cc"
{"fs_id":3970707120,"path":"\/apps\/BDP\/tmp.cc","ctime":1383560072,"mtime":1383560072,"md5":"f1849aa41bef1f013999cbd6d318ca0f","size":635,"request_id":3943963738}
[beyes@groad baidu_pan]$ curl -k -L "https://pcs.baidu.com/rest/2.0/pcs/file?method=list&access_token=3.9843a82ece6459badf07bb5b93ee358a.2592000.1386148691.1629633624-1651105&path=/apps/BDP/"
{"list":[{"fs_id":3970707120,"path":"\/apps\/BDP\/tmp.cc","ctime":1383560072,"mtime":1383560072,"md5":"f1849aa41bef1f013999cbd6d318ca0f","size":635,"isdir":0}],"request_id":1376296270}
[beyes@groad baidu_pan]$ curl -k -O "https://d.pcs.baidu.com/rest/2.0/pcs/file?method=download&access_token=3.9843a82ece6459badf07bb5b93ee358a.2592000.1386148691.1629633624-1651105&path=/apps/BDP/tmp.cc"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
105 635 105 635 0 0 346 0 0:00:01 0:00:01 --:--:-- 775
[beyes@groad baidu_pan]$ ls
tmp.cc
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |