-
Notifications
You must be signed in to change notification settings - Fork 520
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
Support more HTTP methods/verbs #967
Comments
Thanks for this good feedback, I myself wasn't aware of the other HTTP methods 😓... One thing to take note is that being explicit in the fileformat (having a whitelist of method) helps the parser. For instance, we really want to improve the tooling around Hurl. Having well known "syncing" point, like a known list of HTTP method, will make the parser work easier, specially for recovery in case of syntax error. Right away, we can at least add other HTTP methods (for instance Postman support GET, POST, PUT, PATCH, DELETE, COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE, LOCK, UNLOCK, PROPFIND and VIEW) and give us some time to think on this issue. |
@jcamiel Sounds good to me. This is a first easy step that solves 99% of the limitations: custom methods outside of this list aren't frequently used. I see A potential solution would be to display warnings instead of erroring out when a slightly-malformed request is run (just like HTML parsers which are very resilient). I'm not sure it's a priority at this stage of the project though — just wanted to share my thoughts. :) |
Hi guys, I'm trying to solve one mystery. Where does VIEW method comes from? Postman forums does not know it https://community.postman.com/t/what-is-view-method/11053/2 , HTTP Method Registry does not now it, Google does not know it. Any clues / ideas? |
I have no idea! I shamelessly took the methods supported by Postman... |
Haha, all shame then on Postman ;) |
Hi @gladykov your comment makes me think! I don't like that we perpetuate an "unknown" HTTP method in Hurl (
These have the followings advantages:
I like it a lot (obviously 😊), we could deprecate (or remove) |
Another syntax (maybe better) for custom methods:
|
Happy that I could be an inspiration :) Happy coding! |
What we've finally implemented: the method can be any word ([A-Z]+) without quotes. We've added the only constraint of being uppercase (for parsing reason with edge case). In the doc, we're going to only reference the "standard" HTTP method and make clear that a custom (new or legacy) HTTP method is possible:
No file format change except more custom method are allowed. |
Summary
hurl
only supports a very limited subset of the available HTTP methods. See:hurl/packages/hurl_core/src/parser/parsers.rs
Lines 137 to 147 in 6fc568a
But there are many more HTTP methods defined
HTTP Method Registry
: https://www.iana.org/assignments/http-methods/http-methods.xhtmlThe problem
Many APIs such as the WebDAV protocol require methods that
hurl
rejects, such asPROPFIND
: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#testing-requests-with-curlSolution
Don't restrict the HTTP methods that can be used, support any string instead.
Many APIs use custom methods that are not even part of the
HTTP Method Registry
that I linked to. So while adding the methods from this registry would already be a very nice step forward, it wouldn't solve everything.The text was updated successfully, but these errors were encountered: