private function dropbox::_post_request in Dropbox Client 7
Same name and namespace in other branches
- 7.4 dropbox.php \dropbox::_post_request()
- 7.2 dropbox.php \dropbox::_post_request()
- 7.3 dropbox.php \dropbox::_post_request()
2 calls to dropbox::_post_request()
- dropbox::add in ./
dropbox.php - Adds a local file to the authenticated user's dropbox account using the post method
- dropbox::restore in ./
dropbox.php - Restore a file or folder to a previous revision.
File
- ./
dropbox.php, line 377
Class
Code
private function _post_request($uri, $data = false, $specialhost = false) {
$request = "POST {$uri} HTTP/" . self::HTTP_1 . self::LINE_END;
$host = self::HOST;
$extra = array();
if ($specialhost !== false) {
$host = $specialhost;
$extra['Host'] = $specialhost;
}
$url = self::SCHEME . "://{$host}/" . self::API_VERSION . $uri;
$header = $this
->_build_header($url, 'POST', $request, self::LINE_END, $extra);
if (self::DEBUG) {
error_log($header);
}
$response = $this
->_connect($url, $header, 'POST', $data);
return json_decode($response);
}