Closed gixxy22 closed 2 years ago
Hello, with the following change
$client->request('PUT', 'http://example.com', [
'body' => $body,
'http_errors' => false,
'debug' => true,
]);
What are the contents of file log?
This bug has been fixed in develop
.
Please try if you can.
PHP Version
8.1
CodeIgniter4 Version
4.2.10
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Linux
Which server did you use?
fpm-fcgi
Database
MariaDB 10.6.11
What happened?
From the docs: https://codeigniter4.github.io/CodeIgniter4/libraries/curlrequest.html#body
This works:
$client->setBody($body)->request('put', 'http://example.com');
This doesn't:$client->request('put', 'http://example.com', ['body' => $body]);
The latter doesn't seem to set the body and the request sends empty content.
Steps to Reproduce
Create a simple CURL request and try to send data in the body using the options parameter, when debugging enabled, you can see the Content-Length is set to 0.
Expected Output
Expect the request to send the data in the body.
Anything else?
No response