Genie.jl icon indicating copy to clipboard operation
Genie.jl copied to clipboard

Allow body payload for GET requests

Open UniqueTokens opened this issue 2 years ago • 0 comments

Currently Genie allows body payload for POST, PUT, or PATCH requests only.

julia> using Genie

help?> Genie.Router.ispayload
  ispayload(req::HTTP.Request)

  True if the request can carry a payload - that is, it's a POST, PUT, or PATCH request

According RfC 7231 other requests (especially GET) can carry a body payload too. This is particularly useful if the payload contains sensitive data or, because of its (variable) length, cannot be Base64-encoded as a parameter in the URL, or because it should not be cached or logged for other reasons.

POST, PUT, or PATCH are unsuitable if no data is to be created or changed on the server, eg. for pure search queries. A suitable verb is drafted in HTTP SEARCH Method. In the meantime, Genie should follow the relevant decisions as they made Swagger and OpenAPI and allow body payload for GET.

UniqueTokens avatar Aug 16 '21 06:08 UniqueTokens