METHODS

new(SOURCE) or NEW(%params)

Construct a response object from SOURCE. SOURCE can be one of:

  • an integer (200-555)

    Representing a HTTP response status.

    Under Sub::Spec strict mode, you cannot use this.

  • an arrayref [STATUS*, MESSAGE, CONTENT*]

  • an HTTP::Response object

%params:

  • status => INTEGER

    Return status code.

  • message => STRING

    Return error message.

  • content => CONTENT

status

message

content

is_success

Return true if response is success (status is 2xx).