Skip to content

Commit 8416adc

Browse files
committed
Update PHPDocs
1 parent 81f051b commit 8416adc

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/Request.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,11 @@ public function setBody(array | string $body) : static
274274
}
275275

276276
/**
277-
* Set body with JSON data.
277+
* Prepare the Request to send JSON data.
278+
*
279+
* If the HTTP method is GET, it will be upgraded to POST.
280+
* Set Content-Type header to application/json.
281+
* Set request body with JSON-string data.
278282
*
279283
* @param mixed $data
280284
* @param int|null $flags [optional] <p>
@@ -366,6 +370,7 @@ public function getFiles() : array
366370
* Set files for upload.
367371
*
368372
* If the HTTP method is GET, it will be updated to POST.
373+
* Set Content-Type header to multipart/form-data.
369374
*
370375
* @param array<mixed> $files Fields as keys, files
371376
* (CURLFile, CURLStringFile or string filename) as values.
@@ -686,13 +691,15 @@ public function getOption(int $option) : mixed
686691

687692
/**
688693
* Returns string if the Request has not files and curl will set the
689-
* Content-Type header to application/x-www-form-urlencoded. If the Request
690-
* has files, returns an array and curl will set the Content-Type to
691-
* multipart/form-data.
694+
* Content-Type header to application/x-www-form-urlencoded if it is not set.
695+
*
696+
* If the Request has files, returns an array and curl will set the
697+
* Content-Type to multipart/form-data if it is not set. If it's already
698+
* multipart/form-data, curl will append the boundary.
692699
*
693700
* If the Request has files, the $post and $files arrays are converted to
694701
* the array_simple format. Because curl does not understand the PHP
695-
* multi-dimensional arrays.
702+
* multidimensional arrays.
696703
*
697704
* @see https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
698705
* @see ArraySimple::convert()

0 commit comments

Comments
 (0)