Skip to content

Conversation

@bushuai
Copy link
Contributor

@bushuai bushuai commented Aug 30, 2019

Inside Axios.prototype.request function

It's forced to set config.method to GET after mergeConfig if config.method exists
which makes the defaults.method not effective.

// Set default options
const instance = axios.create({ method: 'post', /* options */ })

// use instance.request() or instance()
instance({ url })            
instance.request({ url })     

HTTP method should be POST above.

@felipewmartins
Copy link
Contributor

Hi @bushuai, can you update your local branch?

Inside Axios.prototype.request function, It's forced to set
method to 'get' after `mergeConfig` if config.method exists, which makes the defaults.method not effective.
@felipewmartins
Copy link
Contributor

Thanks @bushuai

genie-youn pushed a commit to genie-youn/axios that referenced this pull request Sep 27, 2019
…est (axios#2383)

Inside Axios.prototype.request function, It's forced to set
method to 'get' after `mergeConfig` if config.method exists, which makes the defaults.method not effective.
This was referenced Jan 7, 2020
@axios axios locked and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants