Skip to content
Client
Server

Reference / @open-music-sdk/core / parseRetryAfter

Function: parseRetryAfter() ​

ts
function parseRetryAfter(header, now?): number | undefined;

Defined in: packages/core/src/retry.ts:107

Retry-After as milliseconds: delay-seconds or an HTTP date. Undefined when absent or unreadable.

Parameters ​

string | null

The header's value, or null when the answer had none.

now? ​

number = ...

The moment a date is measured from, in milliseconds since the epoch. Default: now.

Returns ​

number | undefined

How long the header asks to wait, in milliseconds and never below 0, or undefined when there is no header or it is neither a whole number of seconds nor a date.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.