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

NAME

Net::API::Gett::Request - Gett Request object

PURPOSE

This object encapsulates requests to and from the Gett API server.

You normally shouldn't instanstiate this class on its own as the library will create and return this object when appropriate.

ATTRIBUTES

These are read only attributes.

base_url

Scalar string. Read-only. Populated at object construction. Default value: https://open.ge.tt/1.

ua

User agent object. Read only. Populated at object construction. Uses a default LWP::UserAgent.

METHODS

get()

This method uses the GET HTTP verb to fetch data from the Gett service.

Input:

  • endpoint fragment

Output:

  • Perl hash ref of the JSON response from the API

Gives a fatal error under any error condition.

post()

This method uses the POST HTTP verb to send or fetch data to/from the Gett service.

Input:

  • endpoint fragment

  • data (as a string or Perl hashref)

If the data is a Perl hashref, it will be automatically encoded as JSON.

Output:

  • Perl hash ref of the JSON response from the API

This method will die under any error condition.

put()

This method uses the PUT HTTP verb to send data to the Gett service.

Input:

  • Full endpoint

  • Data filehandle

  • A chunksize

  • the length of the data in bytes

No automatic encoding is done this data. It is passed "as is" to the remote API.

Output:

  • A true value

This method will die under any error condition.

SEE ALSO

Net::API::Gett