daurnimator / lua-http

HTTP Library for Lua. Supports HTTP(S) 1.0, 1.1 and 2.0; client and server.
https://daurnimator.github.io/lua-http/
MIT License
807 stars 82 forks source link

HTTP method must be set in "headers" #133

Closed leonardus closed 6 years ago

leonardus commented 6 years ago

It would make more sense to have the HTTP method be a property of the request object, rather than set in the request's headers object.

Example:

request = http_request.new_from_uri("http://example.org/post")
request.method = "POST"
request:go()
daurnimator commented 6 years ago

lua-http follows HTTP2 convention where method is just another HTTP header.

See https://daurnimator.github.io/lua-http/0.2/#conventions