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

Add support for form parameters #1093

Merged
merged 3 commits into from
Oct 10, 2019
Merged

Add support for form parameters #1093

merged 3 commits into from
Oct 10, 2019

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Oct 10, 2019

This PR adds support for form parameters in the entity, either as plain text or as URL-encoded text.

Developers will register the new FormParamsSupport with their Routing which will subsequently allow them to use request.content().as(FormParams.class) to get convenient access to the form parameters. FormParams extends Parameters for consistency with retrieving other types of parameters.

This is not full form data support, which will probably need to wait for the multipart support.

Resolves #784

@tjquinno
Copy link
Member Author

tjquinno commented Oct 10, 2019

Thanks to Tomas for the review over zoom. The latest commit incorporates his suggestions.

Most notably, the new FormParamsImpl class now extends ReadonlyParameters (instead of basically duplicating that class). Although there is really no behavioral difference between a FormParamsImpl instance and a ReadonlyParameters instance I decided to keep the separate implementation class because that's a good place for the static regex parsing of the entity content and preparing the map that's passed to the constructor. There's nowhere else that is as good a location for that logic.

Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tjquinno tjquinno merged commit b97444d into helidon-io:master Oct 10, 2019
Backlog automation moved this from In Progress to Closed Oct 10, 2019
@tjquinno tjquinno deleted the form-data-support branch October 10, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Backlog
  
Closed
Development

Successfully merging this pull request may close these issues.

Add support for Form parameters in Helidon SE
2 participants