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

Conform to RFC-7231 (HTTP) (HTTP/1.1): Semantics and Content #45

Open
andreujuanc opened this issue May 17, 2022 · 0 comments
Open

Conform to RFC-7231 (HTTP) (HTTP/1.1): Semantics and Content #45

andreujuanc opened this issue May 17, 2022 · 0 comments

Comments

@andreujuanc
Copy link

Hi, some of the endpoints are not confirming to the general practice of http and rest semantics.
This makes it very difficult to integrate with existing software that might have issues with the current spec.

One of the key items we observed were the /quote/in /quote/out endpoints where they are supposed to create a quote and return it. Therefore they are not only retrieving information but also requesting a state change in the server.

According to the RFC https://www.rfc-editor.org/rfc/rfc7231#page-24 Section 4.3 Method Definitions:

The GET method requests transfer of a current selected representation
for the target resource. GET is the primary mechanism of information
retrieval and the focus of almost all performance optimizations.
Hence, when people speak of retrieving some identifiable information
via HTTP, they are generally referring to making a GET request.

Then there are other issues with the body being send with a GET:

A payload within a GET request message has no defined semantics;
sending a payload body on a GET request might cause some existing
implementations to reject the request.

We observed AWS APIGateway failing to process a GET request with a body, we are just scratching the surface here.

Another problem is Cache, according to the RFC:

The response to a GET request is cacheable; a cache MAY use it to
satisfy subsequent GET and HEAD requests unless otherwise indicated
by the Cache-Control header field (Section 5.2 of [RFC7234]).

This mean that some server and client applications will cache GET request by default assuming that it's not a state changing operation.

Would love to hear more from the group that created this spec, and understand the reasoning behind it.

IMHO these requests can be changed to be a POST or even a PUT without affecting functionality.

Thanks

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

1 participant