Struct actix_web::http::header::Allow [−][src]
Expand description
Allow
header, defined in RFC7231
The Allow
header field lists the set of methods advertised as
supported by the target resource. The purpose of this field is
strictly to inform the recipient of valid request methods associated
with the resource.
ABNF
Allow = #method
Example values
GET, HEAD, PUT
OPTIONS, GET, PUT, POST, DELETE, HEAD, TRACE, CONNECT, PATCH, fOObAr
- ``
Examples
use actix_web::HttpResponse;
use actix_web::http::{header::Allow, Method};
let mut builder = HttpResponse::Ok();
builder.insert_header(
Allow(vec![Method::GET])
);
use actix_web::HttpResponse;
use actix_web::http::{header::Allow, Method};
let mut builder = HttpResponse::Ok();
builder.insert_header(
Allow(vec![
Method::GET,
Method::POST,
Method::PATCH,
])
);
Tuple Fields
0: Vec<Method>
Trait Implementations
Returns the name of the header field
Parse a header
type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
Try to convert value to a HeaderValue.
Auto Trait Implementations
impl RefUnwindSafe for Allow
impl UnwindSafe for Allow
Blanket Implementations
Mutably borrows from an owned value. Read more
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more