- PENDING REQUEST OBJECTS
Test::Async::HTTP - unit test code that uses
This module implements a mock version of Net::Async::HTTP suitable for unit tests that virtualises the actual HTTP request/response cycle, allowing the unit test script to inspect the requests made and provide responses to them.
Implements the actual Net::Async::HTTP request API.
The following arguments are handled specially:
The value of a
timeoutargument is captured as an extra header on the request object called
These arguments are entirely ignored.
Convenient wrappers for using the
POST methods with a
URI object and few if any other arguments, returning a
POST with non-form data (as indicated by a plain scalar instead of an
ARRAY reference of form data name/value pairs) needs a
content_type key in
Returns the next pending request wrapper object if one is outstanding (due to an earlier call to
Objects returned by
next_pending respond to the following methods:
Returns the HTTP::Request object underlying this pending request.
Makes the request complete with the given HTTP::Response response. This response is given to the Future that had been returned by the
Alternative to the single
respond method, to allow an equivalent of chunked encoding response.
respond_header responds with the header and initial content, followed by multiple calls to
respond_more to provide more body content, until a final
respond_done call finishes the request.
Paul Evans <firstname.lastname@example.org>