1.1.0 • Published 3 months ago

fetch-ext v1.1.0

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

fetch() extension

Extension of native fetch with:

  • Retryable requests
  • Request timeout
  • Standalone HTTP utilities

options.extension

  • timeout number | string

    Request timeout

  • retry Object

  • json any

    Shortcut for sending JSON serialized data. Equivalent to:

    {
        headers: {
            'content-type': 'application/json',
            'accept':  'application/json',
        },
        body: JSON.stringify(value),
    }

response.extension

  • body()

    Infer and execute body parser based on content-type

1.1.0

3 months ago

1.0.1

7 months ago

1.0.0

7 months ago