LSEG Data Library for TypeScript

Delivery.EndpointRequest.Definition object

This object defines the EndpointRequest with a url and other parameters.

Syntax

Delivery.EndpointRequest.Definition(params: Delivery.EndpointRequestDefinitionParams)

Parameters

Value Description Data type Optional Default value
params An object literal of type Delivery.EndpointRequestDefinitionParams. object No -

Delivery.EndpointRequestDefinitionParams properties:

Value Description Data type Optional Default value
url The url address of the endpoint (either partial or full). string No -
method The HTTP method of the request (see EndpointRequest.Method below). enum Yes Method.GET
queryParameters The query parameters used to apply to the request. object Yes -
bodyParameters The body used to apply to the request. object Yes -
headerParameters The headers used to apply to the request. object Yes -
pathParameters the path variables used to apply to the request. object Yes -
handleAutoRedirect Notifies the HTTP client to handle all HTTP Redirects automatically or not. boolean Yes true

The possible values for the EndpointRequest.Method:

Name Value
Method.GET 'GET'
Method.POST 'POST'
Method.PUT 'PUT'
Method.DELETE 'DELETE'

Returned value

EndpointRequestDefinition object.

Usage

The following example demonstrates how to create an endpoint request definition:

import { Delivery } from '@lsegroup/data';

const definition = Delivery.EndpointRequest.Definition({
    url: '/data/news/v1/analyze',
    queryParameters: { query: 'USA' },
});
`

None.

162 words (0:51 mins)