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(
|
Box::new(
|
||||||
client
|
client
|
||||||
.post("https://httpbin.org/post")
|
.post("https://httpbin.org/post")
|
||||||
.send_json(data)
|
.send_json(&data)
|
||||||
.map_err(Error::from) // <- convert SendRequestError to an Error
|
.map_err(Error::from) // <- convert SendRequestError to an Error
|
||||||
.and_then(|resp| {
|
.and_then(|resp| {
|
||||||
resp // <- this is MessageBody type, resolves to complete body
|
resp // <- this is MessageBody type, resolves to complete body
|
||||||
@ -108,7 +108,7 @@ fn step_x_v2(
|
|||||||
) -> impl Future<Item = SomeData, Error = Error> {
|
) -> impl Future<Item = SomeData, Error = Error> {
|
||||||
client
|
client
|
||||||
.post("https://httpbin.org/post")
|
.post("https://httpbin.org/post")
|
||||||
.send_json(data)
|
.send_json(&data)
|
||||||
.map_err(Error::from) // <- convert SendRequestError to an Error
|
.map_err(Error::from) // <- convert SendRequestError to an Error
|
||||||
.and_then(|resp| {
|
.and_then(|resp| {
|
||||||
resp.from_err()
|
resp.from_err()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user