RelativityHTTPClient

An API exposed to get access to a REST client for making http requests. These functions are available under the `convenienceApi.relativityHttpClient` namespace.

Methods

delete(url, requestOptions)Promise
Makes an HTTP DELETE request to the specified URL.
get(url, requestOptions)Promise
Makes an HTTP GET request to the given URL.
post(url, payload, requestOptions)Promise
Makes an HTTP POST request to the given URL.
put(url, payload, requestOptions)Promise
Makes an HTTP PUT request to the specified URL.
makeRelativityRelativeUrl(url)String
Prefixes the given url with Relativity's base url.
makeRelativityBaseRequestOptions(extendWith)Object
Generates a base requestOptions object for use in calls against services on Relativity.
makeRelativityRestRelativeUrl(url)String
Prefixes the given url with Relativity.Rest's base url.
makeRelativityRestBaseRequestOptions(extendWith)Object
Generates a base requestOptions object for use in calls against Relativity.Rest services.

Properties Details

delete(url, requestOptions) ⇒ Promise

Makes an HTTP DELETE request to the specified URL.

Returns: Promise - Resolves to a Fetch API Response object.

Param Type Description
url String A URL for a request.
requestOptions Undefined | Object (optional) requestOptions object. It defaults to an empty object, and the method is overwritten to a DELETE request.

get(url, requestOptions) ⇒ Promise

Makes an HTTP GET request to the given URL.

Returns: Promise - Resolves to a Fetch API Response object.

Param Type Description
url String A URL for a request.
requestOptions Undefined | Object (optional) requestOptions object. It defaults to an empty object, and the method is overwritten to a GET request.

post(url, payload, requestOptions) ⇒ Promise

Makes an HTTP POST request to the given URL.

Returns: Promise - Resolves to a Fetch API Response object.

Param Type Description
url String A URL for a request.
payload Object | Array A JSON serializable object to send in the request body.
requestOptions Undefined | Object (optional) requestOptions object. It defaults to an empty object, and the method is overwritten to a POST request. The body is overwritten with the stringified payload.

put(url, payload, requestOptions) ⇒ Promise

Makes an HTTP PUT request to the specified URL.

Returns: Promise - Resolves to a Fetch API Response object.

Param Type Description
url String A URL for a request.
payload Object | Array A JSON serializable object to send in the request body.
requestOptions Undefined | Object (optional) requestOptions object. It defaults to an empty object, and the method is overwritten to a PUT request. The body is overwritten with the stringified payload.

makeRelativityRelativeUrl(url) ⇒ String

Prefixes the given url with Relativity's base url.

Returns: String - A Relativity service Url.

Param Type Description
url String Url string, relative to Relativity's base url.

makeRelativityBaseRequestOptions(extendWith) ⇒ Object

Generates a base requestOptions object for use in calls against services on Relativity.

Returns: Object - A base requestOptions object for use in calls against services on Relativity.

Param Type Description
extendWith Undefined | Object (optional) requestOptions object to extend with Relativity base payload details.

makeRelativityRestRelativeUrl(url) ⇒ String

Prefixes the given url with Relativity.Rest's base url.

Returns: String - A Relativity.Rest service Url.

Param Type Description
url String Url string, relative to Relativity.Rest's base url.

makeRelativityRestBaseRequestOptions(extendWith) ⇒ Object

Generates a base requestOptions object for use in calls against Relativity.Rest services.

Returns: Object - A base requestOptions object for use in calls against Relativity.Rest services.

Param Type Description
extendWith Undefined | Object (optional) requestOptions object to extend with Relativity.Rest base payload details.