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

The SWG should consider the "HTTP dilemma" and clarify in the spec #479

Closed
ghobona opened this issue Sep 29, 2020 · 7 comments
Closed

The SWG should consider the "HTTP dilemma" and clarify in the spec #479

ghobona opened this issue Sep 29, 2020 · 7 comments
Assignees

Comments

@ghobona
Copy link
Contributor

ghobona commented Sep 29, 2020

There is a need for the SWG to also consider the "HTTP dilemma".

  • HTTP POST /collections/ <payload=GET query> => alternative to HTTP GET /collections/? if URL gets too long!
  • HTTP POST /collections/ <payload=feature content> => create one/multiple resources

Suggestion to allow HTTP POST to be used for retrieving data, in addition to allowing it to be used for inserting data.

@cmheazel
Copy link
Contributor

From RFC 7231:
"The POST method requests that the target resource process the representation enclosed in the request according to the resource's own specific semantics."

So if you pass a very long URL using POST then the origin server "MAY redirect the user agent to that resource by sending a 303 (See Other) response with the existing resource's identifier in the Location field." if that resource already exists.

If the resource is created through the POST request, then "the origin server SHOULD send a 201 (Created) response containing a Location header field that provides an identifier for the primary resource created"

Seems straight forward to me.

@jerstlouis
Copy link
Member

@cmheazel In the MOAW (workflows) extensions for Processes, we are returning both some data, and a 303 location where the same resource is also available via a GET.

e.g. https://app.swaggerhub.com/apis/jerstlouis/MOAW/MOAW-0.2#/DeferredExecution/execDeferred

@cmheazel
Copy link
Contributor

@jerstlouis I see no reason why that should not be allowed. However, if the resource is created through the process, then a 201 may be more appropriate.

@jerstlouis
Copy link
Member

jerstlouis commented Sep 30, 2020

@cmheazel in our case the data may or may not be created by the process (it could be that it already existed before).

More discussions at https://stackoverflow.com/questions/1226810/is-http-post-request-allowed-to-send-back-a-response-body talks about the cacheability of the responses.

@cmheazel
Copy link
Contributor

@jerstlouis That's the right track. Although the HTTP standard quoted is out of date. I think RFC 7231 is a bit better.

@cportele
Copy link
Member

Features API SWG meeting 2020-10-12: Is this really an issue? If you POST content with a GeoJSON media type, this is different from a form request and can be handled differently. Close this issue?

Besides, "HTTP dilemma" does not get any real hits on Google.

@ghobona ghobona transferred this issue from opengeospatial/OGC-API-Sprint-September-2020 Dec 11, 2020
@cportele
Copy link
Member

Close, there was no additional discussion.

The general POST topic is discussed in #449.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants