mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
Fixed & Imporoved AxiosHeaders class (#5224)
* Refactored AxiosHeaders class; * Added support for instances of AxiosHeaders as a value for the headers option; Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -41,6 +41,10 @@ export default function dispatchRequest(config) {
|
||||
config.transformRequest
|
||||
);
|
||||
|
||||
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
||||
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
||||
}
|
||||
|
||||
const adapter = config.adapter || defaults.adapter;
|
||||
|
||||
return adapter(config).then(function onAdapterResolution(response) {
|
||||
|
||||
Reference in New Issue
Block a user