The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Connector::Proxy::HTTP

DESCRIPTION

Send or retrieve data from a defined URI using HTTP.

USAGE

minimal setup

  Connector::Proxy::HTTP->new({
    LOCATION => 'https://127.0.0.1/my/base/url',
  });

connection settings

See Connector::Role::SSLUserAgent for SSL and HTTP related settings

additional options

named_parameters

not implemented yet

A HashRef, the key/value pairs are set as HTTP headers.

http_auth

A HashRef with user and pass used as credentials to perform a HTTP Basic Authentication.

chomp_result

When working with text documents the transport layer adds a trailing newline which might be unhandy when working with scalar values. If set to a true value, a trailing newline will be removed by calling chomp.

undef_on_404

By default, the connector will die if a resource is not found. If set to a true value the connector returns undef, note that die_on_undef will be obeyed.

Parameter used with set

file/path

You can append a templated string to the LOCATION by setting file, path or simply pass ARGS. See Connector::Role::LocalPath for details.

content

A template toolkit string to generate the payload, receives the payload argument as HasRef in DATA.

content_type

The Content-Type header to use, default is no header.

http_method

The http method to use, default is PUT.

Result Handling

If you need to parse the result returned by get, inherit from the class an implement _parse_result. This method receives the response object from the user agent call and must return a scalar value which is returned to the caller.