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 Option<Extractor> to extractors example #115

Open
boustrophedon opened this issue Sep 30, 2019 · 0 comments
Open

Add Option<Extractor> to extractors example #115

boustrophedon opened this issue Sep 30, 2019 · 0 comments
Labels
code Change to code samples good-first-issue Good for newcomers

Comments

@boustrophedon
Copy link

boustrophedon commented Sep 30, 2019

It would be nice to mention the fact that in addition to using the FromRequest::extract method, you can also use the implementation of FromRequest for Option<T: FromRequest> if you have form data that may or may not exist.

You usually don't control the data being submitted, so it's pretty much always better to use Option<web::Form> rather than just having actix return "Content type error" to the user.

@robjtede robjtede added good-first-issue Good for newcomers code Change to code samples labels Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Change to code samples good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants