Struct haproxy_api::Http [−][src]
The “Http” class contain all the HTTP manipulation functions.
Implementations
impl<'lua> Http<'lua>
[src]
pub fn req_get_headers(&self) -> Result<Headers<'lua>>
[src]
Returns a Headers
table containing all the request headers.
pub fn res_get_headers(&self) -> Result<Headers<'lua>>
[src]
Returns a Headers
table containing all the response headers.
pub fn req_add_header<V: ToLua<'lua>>(&self, name: &str, value: V) -> Result<()>
[src]
Appends an HTTP header field name
with value
in the request.
pub fn res_add_header<V: ToLua<'lua>>(&self, name: &str, value: V) -> Result<()>
[src]
Appends an HTTP header field name
with value
in the response.
pub fn req_del_header(&self, name: &str) -> Result<()>
[src]
Removes all HTTP header fields in the request by name
.
pub fn res_del_header(&self, name: &str) -> Result<()>
[src]
Removes all HTTP header fields in the response by name
.
pub fn req_set_header<V: ToLua<'lua>>(&self, name: &str, value: V) -> Result<()>
[src]
Replaces all occurrence of HTTP request header name
, by only one containing the value
.
pub fn res_set_header<V: ToLua<'lua>>(&self, name: &str, value: V) -> Result<()>
[src]
Replaces all occurrence of HTTP response header name
, by only one containing the value
.
pub fn req_rep_header(
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>
[src]
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>
Matches the regular expression in all occurrences of HTTP request header name
according to regex
,
and replaces them with the replace
argument.
The replacement value can contain back references like 1, 2, …
pub fn res_rep_header(
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>
[src]
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>
Matches the regular expression in all occurrences of HTTP response header name
according to regex
,
and replaces them with the replace
argument.
The replacement value can contain back references like 1, 2, …
pub fn req_set_method(&self, method: &str) -> Result<()>
[src]
Rewrites the request method with the method
.
pub fn req_set_path(&self, path: &str) -> Result<()>
[src]
Rewrites the request path with the path
.
pub fn req_set_query(&self, query: &str) -> Result<()>
[src]
Rewrites the request’s query string which appears after the first question mark (?
)
with the query
.
pub fn req_set_uri(&self, uri: &str) -> Result<()>
[src]
Rewrites the request URI with the uri
.
pub fn res_set_status(&self, status: u16, reason: Option<&str>) -> Result<()>
[src]
Rewrites the response status code with the code
.
If no custom reason is provided, it will be generated from the status.
Trait Implementations
Auto Trait Implementations
impl<'lua> !RefUnwindSafe for Http<'lua>
impl<'lua> !Send for Http<'lua>
impl<'lua> !Sync for Http<'lua>
impl<'lua> Unpin for Http<'lua>
impl<'lua> !UnwindSafe for Http<'lua>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>,
[src]
T: FromLua<'lua>,
pub fn from_lua_multi(
values: MultiValue<'lua>,
lua: &'lua Lua
) -> Result<T, Error>
[src]
values: MultiValue<'lua>,
lua: &'lua Lua
) -> Result<T, Error>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,