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

Misleading verbiage around supported HTTP methods #3140

Closed
timschwab opened this issue Jul 22, 2020 · 2 comments · Fixed by #3802
Closed

Misleading verbiage around supported HTTP methods #3140

timschwab opened this issue Jul 22, 2020 · 2 comments · Fixed by #3802

Comments

@timschwab
Copy link

timschwab commented Jul 22, 2020

Section/Content To Improve

Section: Request method aliases

Quote: "For convenience aliases have been provided for all supported request methods."

Suggested Improvement

The key word in the quote is "supported". This suggests to me that anything not listed is not supported. search is not in the list, which implies that the SEARCH method is not supported. However, I tried the following:

axios.request({
  url: 'testing',
  method: 'search'
});

and it successfully sent a SEARCH request. This shows that the SEARCH method is actually supported. So, I would change the word "supported" to "common". And while we are at it, there needs to be a comma after "convenience". So the improved quote would read:

"For convenience, aliases have been provided for all common request methods."

Relevant File(s)

https://github.com/axios/axios/blob/master/README.md

@jasonsaayman
Copy link
Member

Please can you put a pull request in for this change? I will gladly accept.

@rijkvanzanten
Copy link
Contributor

rijkvanzanten commented May 17, 2021

The same applies to the TypeScript definitions:

axios/index.d.ts

Lines 24 to 34 in 69949a6

export type Method =
| 'get' | 'GET'
| 'delete' | 'DELETE'
| 'head' | 'HEAD'
| 'options' | 'OPTIONS'
| 'post' | 'POST'
| 'put' | 'PUT'
| 'patch' | 'PATCH'
| 'purge' | 'PURGE'
| 'link' | 'LINK'
| 'unlink' | 'UNLINK'

@jasonsaayman Does Axios support any string you pass it, or is there a specific subset?

Opened a PR: #3802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants