Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53656bf519 | ||
|
|
889ca14f5f | ||
|
|
45274fd536 | ||
|
|
a3446f6d99 | ||
|
|
e9ea4dbee2 | ||
|
|
d71cd15d4a | ||
|
|
2d0cd4c8d9 |
@@ -37,7 +37,7 @@ To install unirest-php with Composer, just add the following to your `composer.j
|
||||
```json
|
||||
{
|
||||
"require-dev": {
|
||||
"mashape/unirest-php": "2.*"
|
||||
"mashape/unirest-php": "3.*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -159,7 +159,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a coockie string for enabling coockie handling
|
||||
* Set a cookie string for enabling cookie handling
|
||||
*
|
||||
* @param string $cookie
|
||||
*/
|
||||
@@ -169,7 +169,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a coockie file path for enabling coockie handling
|
||||
* Set a cookie file path for enabling cookie handling
|
||||
*
|
||||
* $cookieFile must be a correct path with write permission
|
||||
*
|
||||
@@ -399,7 +399,11 @@ class Request
|
||||
self::$handle = curl_init();
|
||||
|
||||
if ($method !== Method::GET) {
|
||||
curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method);
|
||||
if ($method === Method::POST) {
|
||||
curl_setopt(self::$handle, CURLOPT_POST, true);
|
||||
} else {
|
||||
curl_setopt(self::$handle, CURLOPT_CUSTOMREQUEST, $method);
|
||||
}
|
||||
|
||||
curl_setopt(self::$handle, CURLOPT_POSTFIELDS, $body);
|
||||
} elseif (is_array($body)) {
|
||||
|
||||
Reference in New Issue
Block a user