Struct haproxy_api::Http [−][src]
pub struct Http<'lua>(_);
Expand description
The “Http” class contain all the HTTP manipulation functions.
Implementations
impl<'lua> Http<'lua>[src]
impl<'lua> Http<'lua>[src]pub fn req_get_headers(&self) -> Result<Headers<'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]
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]
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]
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]
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]
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]
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]
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]
pub fn req_rep_header(
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>[src]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]
pub fn res_rep_header(
&self,
name: &str,
regex: &str,
replace: &str
) -> Result<()>[src]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]
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]
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]
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]
pub fn req_set_uri(&self, uri: &str) -> Result<()>[src]Rewrites the request URI with the uri.
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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>, [src]
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>, [src]pub fn from_lua_multi(
values: MultiValue<'lua>,
lua: &'lua Lua
) -> Result<T, Error>[src]
pub fn from_lua_multi(
values: MultiValue<'lua>,
lua: &'lua Lua
) -> Result<T, Error>[src]Performs the conversion. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more