Struct haproxy_api::Http[][src]

pub struct Http<'lua>(_);

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]

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]

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

impl<'lua> Clone for Http<'lua>[src]

impl<'lua> FromLua<'lua> for Http<'lua>[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<'lua, T> FromLuaMulti<'lua> for T where
    T: FromLua<'lua>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.