seed-rs / seed

A Rust framework for creating web apps
MIT License
3.81k stars 155 forks source link

Error in Documentation of fetch with post #552

Closed Narfinger closed 4 years ago

Narfinger commented 4 years ago

The documentation example is wrong as json returns a Result. https://github.com/seed-rs/seed/blob/480141ce9e520c07e60ddae58244edb40c9f55e9/src/browser/fetch.rs#L64

MartinKavik commented 4 years ago

Perhaps we should split it and add unwrap:

/// let request = Request::new("/api").method(Method::Post).json(form).unwrap();
/// let response = fetch(request).await?;

Feel free to create a PR with changes, thank you!