CURL::close PHP Method

close() public method

See also: HTTPRequest::close()
public close ( )
    public function close()
    {
        if ($this->openned) {
            curl_close($this->curlResource);
            $this->openned = false;
        }
    }

Usage Example

Example #1
0
 public function revokeAuthorization()
 {
     $url = $this->url . "revoke";
     $curl = new CURL($url);
     //Access token parameters
     $data = array("client_id" => $this->client_id, "client_secret" => $this->secret, "grant_type" => "access_token", "refresh_token" => $_SESSION['TDISPATCH']['access']["refresh"], "access_token" => $_SESSION['TDISPATCH']['access']["anonimously"]);
     $curl->setPost($data);
     $result = $curl->getSource();
     $curl->close();
     return json_decode($result, true);
 }