add clear
This commit is contained in:
@@ -557,8 +557,10 @@ class HttpClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
$contentType = 'application/x-www-form-urlencoded';
|
$contentType = 'application/x-www-form-urlencoded';
|
||||||
if (isset($this->header['CONTENT-TYPE'])) {
|
if (isset($this->header['Content-Type'])) {
|
||||||
$contentType = $this->header['CONTENT-TYPE'];
|
$contentType = $this->header['Content-Type'];
|
||||||
|
} else if (isset($this->header['content-type'])) {
|
||||||
|
$contentType = $this->header['content-type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($contentType, 'json') !== false) {
|
if (strpos($contentType, 'json') !== false) {
|
||||||
@@ -712,7 +714,7 @@ class HttpClient
|
|||||||
if (is_array($body)) {
|
if (is_array($body)) {
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
$type = $data['content-type'] ?? 'text/html';
|
$type = $data['content-type'] ?? $data['Content-Type'] ?? 'text/html';
|
||||||
if (strpos($type, 'text/html') !== false) {
|
if (strpos($type, 'text/html') !== false) {
|
||||||
return $body;
|
return $body;
|
||||||
} else if (strpos($type, 'json') !== false) {
|
} else if (strpos($type, 'json') !== false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user