max_message_size

Maximum message size in bytes, defaults to the value of the MOJO_MAX_MESSAGE_SIZE environment variable or 10485760. Setting the value to 0 will allow messages of indefinite size. Note that increasing this value can also drastically increase memory usage, should you for example attempt to parse an excessively large message body with the "body_params", "dom" or "json" methods.

body

body_params

my $params = $msg->body_params;

POST parameters extracted from application/x-www-form-urlencoded or multipart/form-data message body, usually a Mojo::Parameters object. Note that this method caches all data, so it should not be called before the entire message body has been received. Parts of the message body need to be loaded into memory to parse POST parameters, so you have to make sure it is not excessively large.

cookies

my $cookies = $msg->cookies;

Access message cookies. Meant to be overloaded in a subclass.

dom

my $dom = $msg->dom;
my $collection = $msg->dom('a[href]');

Turns message body into a Mojo::DOM object and takes an optional selector to perform a find on it right away, which returns a Mojo::Collection object. Note that this method caches all data, so it should not be called before the entire message body has been received. The whole message body needs to be loaded into memory to parse it, so you have to make sure it is not excessively large.

is_limit_exceeded

json

Decode JSON message body directly using Mojo::JSON if possible, returns undef otherwise. An optional JSON Pointer can be used to extract a specific value with Mojo::JSON::Pointer. Note that this method caches all data, so it should not be called before the entire message body has been received. The whole message body needs to be loaded into memory to parse it, so you have to make sure it is not excessively large.

param

Access POST parameters. Note that this method caches all data, so it should not be called before the entire message body has been received. Parts of the message body need to be loaded into memory to parse POST parameters, so you have to make sure it is not excessively large.