API Docs for: 0.3
Show:

Y.mojito.lib.REST Class

The Rest module for Mojito provides an easy way to make RESTful calls to URLs without messing about with Y.io.

Item Index

Methods

Methods

DELETE

(
  • url
  • params
  • config
  • callback
)

Makes a RESTful DELETE request to specified URL

Parameters:

  • url String

    RESTful URL to hit.

  • params Object

    parameters to add to the request.

  • config Object

    may contain 'headers' or 'timeout' values.

  • callback Function

    called with response or error.

GET

(
  • url
  • params
  • config
  • callback
)

Makes a RESTful GET request to specified URL

Parameters:

  • url String

    RESTful URL to hit.

  • params Object

    parameters to add to the request.

  • config Object

    may contain 'headers' or 'timeout' values.

  • callback Function

    called with response or error.

HEAD

(
  • url
  • params
  • config
  • callback
)

Makes a RESTful HEAD request to specified URL

Parameters:

  • url String

    RESTful URL to hit.

  • params Object

    parameters to add to the request.

  • config Object

    may contain 'headers' or 'timeout' values.

  • callback Function

    called with response or error.

POST

(
  • url
  • params
  • config
  • callback
)

Makes a RESTful POST request to specified URL

Parameters:

  • url String

    RESTful URL to hit.

  • params Object

    parameters to add to the request.

  • config Object

    may contain 'headers' or 'timeout' values.

  • callback Function

    called with response or error.

PUT

(
  • url
  • params
  • config
  • callback
)

Makes a RESTful PUT request to specified URL

Parameters:

  • url String

    RESTful URL to hit.

  • params Object

    parameters to add to the request.

  • config Object

    may contain 'headers' or 'timeout' values.

  • callback Function

    called with response or error.