1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-19 12:25:37 +02:00

ClientRequest::send_body takes impl MessageBody (#2546)

This commit is contained in:
Rob Ede
2021-12-25 02:33:37 +00:00
committed by GitHub
parent 1296e07c48
commit d2590fd46c
18 changed files with 853 additions and 687 deletions

View File

@@ -5,13 +5,13 @@ use futures_core::Stream;
use serde::Serialize;
use actix_http::{
body::MessageBody,
error::HttpError,
header::{HeaderMap, HeaderName, TryIntoHeaderValue},
Method, RequestHead, Uri,
};
use crate::{
any_body::AnyBody,
sender::{RequestSender, SendClientRequest},
BoxError, ClientConfig,
};
@@ -46,7 +46,7 @@ impl FrozenClientRequest {
/// Send a body.
pub fn send_body<B>(&self, body: B) -> SendClientRequest
where
B: Into<AnyBody>,
B: MessageBody + 'static,
{
RequestSender::Rc(self.head.clone(), None).send_body(
self.addr,
@@ -159,7 +159,7 @@ impl FrozenSendBuilder {
/// Complete request construction and send a body.
pub fn send_body<B>(self, body: B) -> SendClientRequest
where
B: Into<AnyBody>,
B: MessageBody + 'static,
{
if let Some(e) = self.err {
return e.into();