Method SubmitAsync
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
SubmitAsync(object?, SubmitOptions?, CancellationToken)
Submits formData as React Router's router.navigate(to, { formMethod,
formData }) does; routing.md owns what each method does. A get submission navigates
with the form data as its query string. Another form method calls the action of the route the target
path matches, reporting Submitting while it runs, and commits its result
for UseActionData or its failure as that route's error. A method no form takes commits React
Router's 405 error.
public VelvetTask<NavigationResult> SubmitAsync(object? formData, SubmitOptions? options = null, CancellationToken cancellationToken = default)
Parameters
formDataobjectWhat the submission sends. A
getsubmission encodes the body asrouting.mdlists, in order, as its query string; a body that cannot be encoded commits an error in the navigation.optionsSubmitOptionsHow to submit; null takes every default. A null Action submits to the current location.
cancellationTokenCancellationTokenToken forwarded to the action and the loaders.
Returns
- VelvetTask<NavigationResult>
The outcome, as NavigateAsync(string, NavigationMode, CancellationToken) reports it. A failure an action or a method commits reports Success.