PHPCURL extension can help us quickly implement HTTP requests. When using the doubanoauth logon interface, we need to send the HTTPREQUEST request: GETv2user ~ MeHTTP1.1Host: api. douban. comAuthorization: Bearera14afef0f66fcffce3e0fcd2e34f6ff4 run this command in the command line.
Php curl extension can help us quickly implement HTTP requests. When using the doubanoauth login interface, we need to send such an http request: GET/v2/user /~ Me HTTP/1.1 Host: https://api.douban.comAuthorization: Bearer a14afef0f66fcffce3e0fcd2e34f6ff4 in the command line we execute this way
Php curl extension can help us quickly implement HTTP requests.
When using the doubanoauth login interface, we need to send such an http request:
GET /v2/user/~me HTTP/1.1Host: https://api.douban.comAuthorization: Bearer a14afef0f66fcffce3e0fcd2e34f6ff4
Run the following command in the command line:
curl "https://api.douban.com/v2/user/~me" -H "Authorization: Bearer a14afef0f66fcffce3e0fcd2e34f6ff4"
Php curl sends Authorization HTTP Request
HTTP CURLRunPOST?Method:
$crl = curl_init();$headr = array();$headr[] = 'Authorization: '.$douban_user_name.' '.$accesstoken;curl_setopt($crl, CURLOPT_HTTPHEADER,$headr);curl_setopt($crl, CURLOPT_POST,true);$rest = curl_exec($crl);curl_close($crl);print_r($rest);
If you need http curl to implement GET requests, see the following:
(...)
Read the rest of php curl to execute the Authorization request (34 words)
©Li Xi for lixphp, 2014. | Permalink | No comment | Add todel. icio. us
Post tags: Authorization, curl, GET, HTTP, Post
Feed enhanced by Better Feed from Ozh