Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing set config.method after mergeConfig for Axios.prototype.request #2383

Merged
merged 1 commit into from Sep 6, 2019

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
Collaborator

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
Collaborator

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.

None yet

2 participants