1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 18:37:41 +02:00

use IntoHeaderValue and Header for client request

This commit is contained in:
Nikolay Kim
2018-03-06 15:18:04 -08:00
parent ceb97cd6b9
commit 14a511bdad
3 changed files with 54 additions and 8 deletions

View File

@ -18,6 +18,7 @@ use actix::prelude::*;
use body::{Body, Binary};
use error::UrlParseError;
use header::IntoHeaderValue;
use payload::PayloadHelper;
use httpmessage::HttpMessage;
@ -193,7 +194,7 @@ impl Client {
/// Set request header
pub fn header<K, V>(mut self, key: K, value: V) -> Self
where HeaderName: HttpTryFrom<K>, HeaderValue: HttpTryFrom<V>
where HeaderName: HttpTryFrom<K>, V: IntoHeaderValue
{
self.request.header(key, value);
self