mirror of
https://github.com/actix/examples
synced 2025-01-22 22:05:57 +01:00
fix: send_json(data) -> send_json(&data)
This commit is contained in:
parent
6dccd567db
commit
4f4acbd727
@ -61,7 +61,7 @@ fn step_x_v1(
|
||||
Box::new(
|
||||
client
|
||||
.post("https://httpbin.org/post")
|
||||
.send_json(data)
|
||||
.send_json(&data)
|
||||
.map_err(Error::from) // <- convert SendRequestError to an Error
|
||||
.and_then(|resp| {
|
||||
resp // <- this is MessageBody type, resolves to complete body
|
||||
@ -108,7 +108,7 @@ fn step_x_v2(
|
||||
) -> impl Future<Item = SomeData, Error = Error> {
|
||||
client
|
||||
.post("https://httpbin.org/post")
|
||||
.send_json(data)
|
||||
.send_json(&data)
|
||||
.map_err(Error::from) // <- convert SendRequestError to an Error
|
||||
.and_then(|resp| {
|
||||
resp.from_err()
|
||||
|
Loading…
x
Reference in New Issue
Block a user