pub struct ExpectContinue { /* private fields */ }
Expand description
Controls the use of the Expect
request header when sending request bodies
with HTTP/1.1.
By default, when sending requests containing a body of large or unknown length over HTTP/1.1, Isahc will send the request headers first without the body and wait for the server to respond with a 100 (Continue) status code, as defined by RFC 7231, Section 5.1.1. This gives the opportunity for the server to reject the response without needing to first transmit the request body over the network, if the body contents are not necessary for the server to determine an appropriate response.
For servers that do not support this behavior and instead simply wait for the request body without responding with a 100 (Continue), there is a limited timeout before the response body is sent anyway without confirmation. The default timeout is 1 second, but this can be configured.
The Expect
behavior can also be disabled entirely.
This configuration only takes effect when using HTTP/1.1.
Implementations§
Source§impl ExpectContinue
impl ExpectContinue
Sourcepub const fn enabled() -> Self
pub const fn enabled() -> Self
Enable the use of Expect
and wait for a 100 (Continue) response with a
default timeout before sending a request body.
Trait Implementations§
Source§impl Clone for ExpectContinue
impl Clone for ExpectContinue
Source§fn clone(&self) -> ExpectContinue
fn clone(&self) -> ExpectContinue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more