federicotdn / verb

Organize and send HTTP requests from Emacs
https://melpa.org/#/verb
GNU General Public License v3.0
545 stars 20 forks source link

Allow specifying protocol version in request specs #65

Open federicotdn opened 7 months ago

federicotdn commented 7 months ago

Users could optionally specify HTTP protocol versions. Instead of

get http://example/com

one could write:

get http://example.com http/1.1

(upper case would be parsed correctly as well) Adding the protocol version would be of course optional and 1.1 would be assumed if omitted. All this could be useful in the future if url.el is updated to support HTTP 2.0 or 3.0.

vHugoObject commented 3 months ago

Can I take this?

federicotdn commented 3 months ago

Yes! Do you have an initial idea of how you would like to implement it?

vHugoObject commented 2 months ago

Hey, sorry for not getting back. I have been working on this and will hopefully be done within the next week. I have tried to implement protocol the same way method is implemented. I have added a defconst for valid protocols, a verb--http-protocol-type, a verb--http-protocol-p and a verb--http-protocols-regexp. I have also added protocol to the request spec. I am now working on turning the method+url section into method+url+protocol, so that users could make requests just as you suggested: get http://example.com http/1.1.

federicotdn commented 2 months ago

No worries! That sounds good; feel free to open a PR anytime.

vHugoObject commented 2 months ago

Have you gotten a chance to look at my PR yet?