actix-website icon indicating copy to clipboard operation
actix-website copied to clipboard

Add Option<Extractor> to extractors example

Open boustrophedon opened this issue 6 years ago • 0 comments

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.

boustrophedon avatar Sep 30 '19 21:09 boustrophedon