mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-14 04:16:32 +00:00
Fix #305: Implement Curl::getResponseCookies()
This commit is contained in:
@@ -211,6 +211,7 @@ Curl::getCookie($key)
|
||||
Curl::getInfo($opt = null)
|
||||
Curl::getOpt($option)
|
||||
Curl::getResponseCookie($key)
|
||||
Curl::getResponseCookies()
|
||||
Curl::head($url, $data = array())
|
||||
Curl::options($url, $data = array())
|
||||
Curl::patch($url, $data = array())
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use \Curl\Curl;
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->get('https://secure.php.net/');
|
||||
|
||||
if ($curl->error) {
|
||||
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage . "\n";
|
||||
} else {
|
||||
echo 'Response cookies:' . "\n";
|
||||
var_dump($curl->responseCookies);
|
||||
var_dump($curl->getResponseCookies());
|
||||
}
|
||||
@@ -745,6 +745,18 @@ class Curl
|
||||
return isset($this->responseCookies[$key]) ? $this->responseCookies[$key] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Response Cookies
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResponseCookies()
|
||||
{
|
||||
return $this->responseCookies;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Max Filesize
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user