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

Support form encoded POST requests #754

Closed
fengelniederhammer opened this issue Apr 24, 2024 · 0 comments · Fixed by #761 or #778
Closed

Support form encoded POST requests #754

fengelniederhammer opened this issue Apr 24, 2024 · 0 comments · Fixed by #761 or #778
Assignees
Labels
LAPIS Tasks/PR related to LAPIS

Comments

@fengelniederhammer
Copy link
Contributor

fengelniederhammer commented Apr 24, 2024

Support accepting form encoded requests with the content type application/x-www-form-urlencoded. This improves browser support, because a browser can simply submit a form like this to get a valid LAPIS call:

<form action="my.lapis/sample/aggregated" method="POST">
    <input type="text" name="country" />
    <input type="submit" value="Submit" />
</form>

For GET methods, this is already supported by LAPIS, since the form data just ends up in the query string. URLs have a length limited, so this doesn't work for large requests (e.g. someone requesting data for 1000 primary keys).

  • This should be supported for every endpoint
  • It should support setting the dataFormat to return the data as JSON, CSV or TSV.

Implementation-wise we could implement it in two different ways:

  1. accept form value query that is expected to contain a JSON that translates to a valid POST request to the respective endpoint.
  2. accept all fields separately in the URL encoded form format.

We could also support both. Let's see how well Spring supports form url encoded requests and what is easiest to implement.

@fengelniederhammer fengelniederhammer added the LAPIS Tasks/PR related to LAPIS label Apr 24, 2024
@fengelniederhammer fengelniederhammer self-assigned this Apr 24, 2024
fengelniederhammer added a commit that referenced this issue Apr 30, 2024
This adds support for using LAPIS via plain HTML forms with `method="POST"` and content type `application/x-www-form-urlencoded`

resolves #754
fengelniederhammer added a commit that referenced this issue Apr 30, 2024
This adds support for using LAPIS via plain HTML forms with `method="POST"` and content type `application/x-www-form-urlencoded`

resolves #754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LAPIS Tasks/PR related to LAPIS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant