Skip to content

Ability to specify a timeout for a REST API endpoint #6526

@ffxsam

Description

@ffxsam

Describe the solution you'd like
It would be nice to configure a timeout value for a REST API endpoint. Currently the default is 0, which isn't a great idea, as users will be stuck loading indefinitely if there's a network issue.

Describe alternatives you've considered
The only workaround is to pass a timeout with every call, e.g.:

    const data = await RestAPI.get('private', '/tracks', {
      queryStringParameters: {
        omit: 'name_tok,metadata_tok',
        folder_id: folderId,
      },
      timeout: 10000,
    });

IMO a sensible implementation of this could look like this:

RestAPI.configure({
  endpoints: [
    {
      name: 'endpoint1',
      endpoint: 'xxx',
      timeout: 10000,
    },
  ],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelated to REST API issuesfeature-requestRequest a new featureneed-product-inputNeeds non-technical requirements or direction to proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions