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

--request "VERB" is insufficient for certain HTTP methods (head) #52

Closed
gyula-ny opened this issue Nov 14, 2016 · 1 comment
Closed

Comments

@gyula-ny
Copy link

Hi,

as I see the http method is specified with the "--request" curl option - which, however, doesn't work with e.g. "head" requests. As the curl(1) manpage says about --request/-X

"This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using -X HEAD will not suffice. You need to use the -I, --head option."

Also:
"The method string you set with -X will be used for all requests, which if you for example use -L, --location may cause unintended side-effects when curl doesn't change request method according to the HTTP 30x response codes - and similar."

@chriso
Copy link
Contributor

chriso commented Nov 14, 2016

Try passing {url: <url>, head: true} instead of {url: <url>, method: 'HEAD'}.

@chriso chriso closed this as completed Nov 14, 2016
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

No branches or pull requests

2 participants