if (isset($options['form_params'
])) { if (isset($options['multipart'
])) { throw new InvalidArgumentException('You cannot use '
.'form_params and multipart at the same time. Use the '
.'form_params option if you want to send application/'
.'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'
]);