Lines Matching defs:body
16 * Creates a cURL handle, header resource, and body resource based on a
23 * response body handle.
51 $body = $this->getOutputBody($request, $options);
54 return [$handle, &$headers, $body];
64 * @param resource $body Body fopen response.
73 $body
86 $response['body'] = $body;
132 'body' => null,
140 // Determine where the body of the response (if any) will be streamed.
150 // Create a default body if one was not provided
202 if (isset($request['body'])) {
231 // Send the body as a string if the size is less than 1MB OR if the
235 is_string($request['body'])
237 $options[CURLOPT_POSTFIELDS] = Core::body($request);
264 $body = $request['body'];
266 if ($body instanceof StreamInterface) {
267 $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
268 return (string) $body->read($length);
271 if ($size = $body->getSize()) {
275 } elseif (is_resource($body)) {
276 $options[CURLOPT_INFILE] = $body;
277 } elseif ($body instanceof \Iterator) {
279 $options[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body, &$buf) {
280 if ($body->valid()) {
281 $buf .= $body->current();
282 $body->next();
289 throw new \InvalidArgumentException('Invalid request body provided');
528 // If there is no body, then there is some other kind of issue. This
530 if (!isset($request['body'])) {
532 . 'with no body. This could mean that you are saturating your '
540 . 'retried, but attempting to rewind the request body failed.';
549 . 'and did no succeed. cURL was unable to rewind the body of '