NAME
Mojo::Transactor - Transaction Builder
SYNOPSIS
DESCRIPTION
Mojo::Transactor is the request building framework used by Mojo::UserAgent. Note that this module is EXPERIMENTAL and might change without warning!
METHODS
Mojo::Transactor inherits all methods from Mojo::Base and implements the following new ones.
form
my
$tx
=
$t
->form(
'UTF-8'
,
{
test
=> 123}
);
my
$tx
=
$t
->form(
{
test
=> 123},
{
Accept
=>
'*/*'
}
);
my
$tx
=
$t
->form(
'UTF-8'
,
{
test
=> 123},
{
Accept
=>
'*/*'
}
);
my
$tx
=
$t
->form(
{
file
=> {
file
=>
'/foo/bar.txt'
}}
);
my
$tx
=
$t
->form(
{
file
=> {
content
=>
'lalala'
}}
);
my
$tx
=
$t
->form(
{
myzip
=> {
file
=>
$asset
,
filename
=>
'foo.zip'
}}
);
Versatile Mojo::Transaction::HTTP builder for form requests.
$tx
->res->body(
sub
{
$_
[1] });
$ua
->start(
$tx
);
proxy_connect
my
$tx
=
$t
->proxy_connect(
$old
);
Build Mojo::Transaction::HTTP proxy connect request for transaction.
redirect
my
$tx
=
$t
->redirect(
$old
);
Build Mojo::Transaction::HTTP followup request for redirect response.
tx
my
$tx
=
$t
->tx(
GET
=>
'mojolicio.us'
);
my
$tx
=
$t
->tx(
);
Versatile general purpose Mojo::Transaction::HTTP builder for requests.
# Streaming response
$tx
->res->body(
sub
{
$_
[1] });
$ua
->start(
$tx
);
# Custom socket
$tx
->connection(
$socket
);
$ua
->start(
$tx
);
websocket
Versatile Mojo::Transaction::WebSocket builder for WebSocket handshake requests.