Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function get_curl_handle_for_request($method, $params) {
- list($get, $post) = $this->finalize_params($method, $params);
- $post_string = $this->create_url_string($post);
- $get_string = $this->create_url_string($get);
- $url_with_get = $this->server_addr . '?' . $get_string;
- $useragent = 'Facebook API PHP5 Client 1.1 (curl) ' . phpversion();
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url_with_get);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30);
- return $ch;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement