Open BartMassey opened 2 years ago
I think it would be better if the second
body()
builder returned anErr
at runtime.
Returning an Err
is impossible based on the current API:
pub fn body<T: Into<Body>>(mut self, body: T) -> RequestBuilder {}
Ugh. Good point; don't know what I was thinking. panic()
, I guess?
In this example
the client will post with a body of just "world".
I think it would be better if the second
body()
builder returned anErr
at runtime. (It would be better to track this all with typestate to get compile-time errors, but that would be an impossible API change at this point.)Issue inspired by this Reddit post. Putting both a
form()
andbody()
in the same request seems like a reasonably easy mistake to make, and could result in wasted work at best and really confusing behavior at worst.