Transaction builder, defaults to a Mojo::UserAgent::Transactor object. You can also append a callback to perform requests non-blocking. Same as "delete" , but performs all requests non-blocking and returns a Mojo::Promise object instead of accepting a callback. Same as "get" , but performs all requests non-blocking and returns a Mojo::Promise object instead of accepting a callback. Same as "head" , but performs all requests non-blocking and returns a Mojo::Promise object instead of accepting a callback.
Same as "options" , but performs all requests non-blocking and returns a Mojo::Promise object instead of accepting a callback. Where it stops being fine is when you have Mojo::UserAgent::Mockable on board:.
Mojolicious::Lite will replace the current UA's internal application server's application instance "app" in Mojo::UserAgent::Server with the Mojolicious::Lite application. This will break the playback functionality, as this depends on a custom Mojolicious application internal to the module.
Instead, define your application in a separate package not necessarily a separate file , like so:. To install Mojo::UserAgent::Mockable, copy and paste the appropriate command in to your terminal. For more information on module installation, please visit the detailed CPAN module installation guide. The saved response is returned, and no HTTP request is sent to the remote host. One of: passthrough Operates like Mojo::UserAgent in all respects.
One of: exception Throw an exception i. Playback mode When this class is instantiated, the instance will read the transaction cache from the file specified by "file". Local application server Using this module against a local app, e.
These mappings can be easily extended or changed with "types" in Mojolicious. To install Mojolicious::Plugin::RenderFile, copy and paste the appropriate command in to your terminal. For more information on module installation, please visit the detailed CPAN module installation guide. Supported Options: filepath Path on the filesystem to the file. You will often see tests written using Mojolicious::Lite like so:.
And this is all fine. Where it stops being fine is when you have Mojo::UserAgent::Mockable on board:. Mojolicious::Lite will replace the current UA's internal application server's application instance "app" in Mojo::UserAgent::Server with the Mojolicious::Lite application.
This will break the playback functionality, as this depends on a custom Mojolicious application internal to the module. Instead, define your application in a separate package not necessarily a separate file , like so:.
To install Mojo::UserAgent::Mockable, copy and paste the appropriate command in to your terminal. For more information on module installation, please visit the detailed CPAN module installation guide.
The saved response is returned, and no HTTP request is sent to the remote host. One of: passthrough Operates like Mojo::UserAgent in all respects. One of: exception Throw an exception i.
0コメント