MultipartStream example

'x-www-form-urlencoded requests, and the multipart '
                    .'option to send multipart/form-data requests.');
            }
            $options['body'] = \http_build_query($options['form_params'], '', '&');
            unset($options['form_params']);
            // Ensure that we don't have the header in different case and set the new value.             $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type']$options['_conditional']);
            $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
        }

        if (isset($options['multipart'])) {
            $options['body'] = new Psr7\MultipartStream($options['multipart']);
            unset($options['multipart']);
        }

        if (isset($options['json'])) {
            $options['body'] = Utils::jsonEncode($options['json']);
            unset($options['json']);
            // Ensure that we don't have the header in different case and set the new value.             $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type']$options['_conditional']);
            $options['_conditional']['Content-Type'] = 'application/json';
        }

        
Home | Imprint | This part of the site doesn't use cookies.