diff --git a/src/Network/Http.php b/src/Network/Http.php index fc9c4943e..693365aa4 100644 --- a/src/Network/Http.php +++ b/src/Network/Http.php @@ -1,6 +1,7 @@ requestData = $payload; + $this->header('Content-Type', 'application/json'); + + return $this; + } + /** * Add a data to the request. - * @param string $value - * @return self */ - public function data($key, $value = null) + public function data(array|string $key, string $value = null): self { if (is_array($key)) { foreach ($key as $_key => $_value) { $this->data($_key, $_value); } - return $this; + } else { + $this->requestData[$key] = $value; } - - $this->requestData[$key] = $value; return $this; }