Request
Object Hierarchy:
Description:
public class Request :
Object
Represents the HTTP request. This is generated by the Ambition engine and passed to a given controller and action.
Content:
Properties:
- public HashMap<string,Cookie> cookies { set; get; }
Provides all cookies set for this request.
- public HashMap<string,string> @params { set; get; }
All query and body parameters for this request.
- public HashMap<string,string> headers { set; get; }
All incoming headers in this request.
- public HttpMethod method { set; get; }
HTTP request method.
- public string? content_type { set; get; }
Request content type.
- public string ip { set; get; }
Remote IP address connecting to this server.
- public string uri { get; }
Request URI/URL.
- public string base_uri { get; }
Base URI/URL.
- public string protocol { get; }
Protocol being used to access this resource, according to the best
guess of the engine or framework. Some proxies and engines do not provide this information accurately.
- public string host { get; }
Hostname of the server.
- public int port { get; }
Port being requested.
- public string path { set; get; }
Path of the request URL.
- public uint8[] request_body { set; get; }
Raw, unparsed request body. Note that if the content type is
multipart/form-data, this will only contain the form-data portion of the incoming MIME document.
- public string[] captures { set; get; }
Retrieve the list of URL captures, if requested.
- public HashMap<string,RequestFile> files { set; get; }
- public HashMap<string,string> named_captures { set; get; }
Retrieve named captures, if requested.
- public string _arguments { set; get; }
Static methods:
Creation methods:
Methods:
- public void set_uri (string protocol, string host, string raw_path, string clean_path)
Set the URI given the components of a URL.
- public void initialize (HttpMethod method, string ip, string protocol, string host, string raw_path, string clean_path, HashMap<string,string> @params, HashMap<string,string> headers, string? content_type = null)
- public string? param (string key)
Retrieve a request parameter by name, null if unavailable.
- public string? header (string key)
Retrieve a request header by name, null if unavailable.
- public string[]? arguments ()
Retrieve the list of URL arguments, if supported by dispatch type.
- public string? get_capture (string capture_name)
Retrieve a URL capture by name, null if unavailable.
- public string? get_capture_index (int capture_index)
Retrieve a URL capture by index, null if unavailable.
- public Cookie? get_cookie (string name)
Retrieve a request cookie by name, null if unavailable.
- public void set_cookie (Cookie cookie)
Add a cookie to the list of request cookies.
Inherited Members:
All known members inherited from class GLib.Object