Class

Reket

Reket(config)

Main class of the component. This class implements all CRUD methods (get, post, put, delete).

Simply configure a client (at least) and you will be able to make HTTP calls.

Constructor

# new Reket(config)

Parameters:
Name Type Description
config ReketConfig | Object

An instance of ReketConfig instance or an object with the options for creating a ReketConfig instance.

See:
  • ReketConfig constructor for available options in case of `config` parameter is an Object.

View Source reket.js, line 4

Members

ReketClient

# readonly client

Shortcut to get the configured client from config.

View Source reket.js, line 31

ReketConfig

# readonly config

Configuration used by Reket instance.

View Source reket.js, line 18

Methods

# delete(urlOrReketRequest, optionsopt) → {Promise}

Send a DELETE request.

Parameters:
Name Type Attributes Default Description
urlOrReketRequest string | ReketRequest

An url where to DELETE or an instance of ReketRequest that will be passed to request method.

options Object <optional>
{}

Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string.

View Source reket.js, line 200

Promise returned by request method.

Promise

# get(urlOrReketRequest, optionsopt) → {Promise}

Send a GET request.

Parameters:
Name Type Attributes Default Description
urlOrReketRequest string | ReketRequest

An url to GET or an instance of ReketRequest that will be passed to request method.

options Object <optional>
{}

Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string.

View Source reket.js, line 119

Promise returned by request method.

Promise

# post(urlOrReketRequest, dataopt, optionsopt) → {Promise}

Send a POST request.

Parameters:
Name Type Attributes Default Description
urlOrReketRequest string | ReketRequest

An url where to POST or an instance of ReketRequest that will be passed to request method.

data Object <optional>
{}

Data to be sent as the request message data.

options Object <optional>
{}

Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string.

View Source reket.js, line 143

Promise returned by request method.

Promise

# put(urlOrReketRequest, dataopt, optionsopt) → {Promise}

Send a PUT request.

Parameters:
Name Type Attributes Default Description
urlOrReketRequest string | ReketRequest

An url where to PUT or an instance of ReketRequest that will be passed to request method.

data Object <optional>
{}

Data to be sent as the request message data.

options Object <optional>
{}

Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string.

View Source reket.js, line 172

Promise returned by request method.

Promise

# request(reketRequest) → {Promise}

Send an HTTP request with the configured client.

Parameters:
Name Type Description
reketRequest ReketRequest

An instance of ReketRequest as options.

View Source reket.js, line 84

That returns an instance of ReketResponse in case of success, an instance ReketError in case of error.

Promise