Struct actix_http::test::TestRequest
source · pub struct TestRequest(_);Expand description
Test Request builder.
Implementations§
source§impl TestRequest
impl TestRequest
sourcepub fn with_uri(path: &str) -> TestRequest
pub fn with_uri(path: &str) -> TestRequest
Create a default TestRequest and then set its URI.
sourcepub fn insert_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self
pub fn insert_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self
Insert a header, replacing any that were set with an equivalent field name.
sourcepub fn append_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self
pub fn append_header(&mut self, header: impl TryIntoHeaderPair) -> &mut Self
Append a header, keeping any that were set with an equivalent field name.
sourcepub fn set_payload(&mut self, data: impl Into<Bytes>) -> &mut Self
pub fn set_payload(&mut self, data: impl Into<Bytes>) -> &mut Self
Set request payload.
pub fn take(&mut self) -> TestRequest
Trait Implementations§
source§impl Default for TestRequest
impl Default for TestRequest
source§fn default() -> TestRequest
fn default() -> TestRequest
Returns the “default value” for a type. Read more