Skip to content

An HTTP request client that provides an axios like interface over top of node-fetch. Super lightweight. Supports proxies and all sorts of other stuff.

License

googleapis/gaxios

main
Switch branches/tags
Code

Latest commit

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [puppeteer](https://togithub.com/puppeteer/puppeteer) | [`^16.0.0` -> `^17.0.0`](https://renovatebot.com/diffs/npm/puppeteer/16.2.0/17.1.3) | [![age](https://badges.renovateapi.com/packages/npm/puppeteer/17.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/puppeteer/17.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/puppeteer/17.1.3/compatibility-slim/16.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/puppeteer/17.1.3/confidence-slim/16.2.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>puppeteer/puppeteer</summary>

### [`v17.1.3`](https://togithub.com/puppeteer/puppeteer/blob/HEAD/CHANGELOG.md#&#8203;1713-httpsgithubcompuppeteerpuppeteercomparev1712v1713-2022-09-08)

[Compare Source](https://togithub.com/puppeteer/puppeteer/compare/v17.1.2...v17.1.3)

##### Bug Fixes

-   FirefoxLauncher should not use BrowserFetcher in puppeteer-core ([#&#8203;8920](https://togithub.com/puppeteer/puppeteer/issues/8920)) ([f2e8de7](https://togithub.com/puppeteer/puppeteer/commit/f2e8de777fc5d547778fdc6cac658add84ed4082)), closes [#&#8203;8919](https://togithub.com/puppeteer/puppeteer/issues/8919)
-   linux arm64 check on windows arm ([#&#8203;8917](https://togithub.com/puppeteer/puppeteer/issues/8917)) ([f02b926](https://togithub.com/puppeteer/puppeteer/commit/f02b926245e28b5671087c051dbdbb3165696f08)), closes [#&#8203;8915](https://togithub.com/puppeteer/puppeteer/issues/8915)

### [`v17.1.2`](https://togithub.com/puppeteer/puppeteer/blob/HEAD/CHANGELOG.md#&#8203;1712-httpsgithubcompuppeteerpuppeteercomparev1711v1712-2022-09-07)

[Compare Source](https://togithub.com/puppeteer/puppeteer/compare/v17.1.1...v17.1.2)

##### Bug Fixes

-   add missing code coverage ranges that span only a single character ([#&#8203;8911](https://togithub.com/puppeteer/puppeteer/issues/8911)) ([0c577b9](https://togithub.com/puppeteer/puppeteer/commit/0c577b9bf8855dc0ccb6098cd43a25c528f6d7f5))
-   add Page.getDefaultTimeout getter ([#&#8203;8903](https://togithub.com/puppeteer/puppeteer/issues/8903)) ([3240095](https://togithub.com/puppeteer/puppeteer/commit/32400954c50cbddc48468ad118c3f8a47653b9d3)), closes [#&#8203;8901](https://togithub.com/puppeteer/puppeteer/issues/8901)
-   don't detect project root for puppeteer-core ([#&#8203;8907](https://togithub.com/puppeteer/puppeteer/issues/8907)) ([b4f5ea1](https://togithub.com/puppeteer/puppeteer/commit/b4f5ea1167a60c870194c70d22f5372ada5b7c4c)), closes [#&#8203;8896](https://togithub.com/puppeteer/puppeteer/issues/8896)
-   support scale for screenshot clips ([#&#8203;8908](https://togithub.com/puppeteer/puppeteer/issues/8908)) ([260e428](https://togithub.com/puppeteer/puppeteer/commit/260e4282275ab1d05c86e5643e2a02c01f269a9c)), closes [#&#8203;5329](https://togithub.com/puppeteer/puppeteer/issues/5329)
-   work around a race in waitForFileChooser ([#&#8203;8905](https://togithub.com/puppeteer/puppeteer/issues/8905)) ([053d960](https://togithub.com/puppeteer/puppeteer/commit/053d960fb593e514e7914d7da9af436afc39a12f)), closes [#&#8203;6040](https://togithub.com/puppeteer/puppeteer/issues/6040)

### [`v17.1.1`](https://togithub.com/puppeteer/puppeteer/blob/HEAD/CHANGELOG.md#&#8203;1711-httpsgithubcompuppeteerpuppeteercomparev1710v1711-2022-09-05)

[Compare Source](https://togithub.com/puppeteer/puppeteer/compare/v17.1.0...v17.1.1)

##### Bug Fixes

-   restore deferred promise debugging ([#&#8203;8895](https://togithub.com/puppeteer/puppeteer/issues/8895)) ([7b42250](https://togithub.com/puppeteer/puppeteer/commit/7b42250c7bb91ac873307acda493726ffc4c54a8))

### [`v17.1.0`](https://togithub.com/puppeteer/puppeteer/blob/HEAD/CHANGELOG.md#&#8203;1710-httpsgithubcompuppeteerpuppeteercomparev1700v1710-2022-09-02)

[Compare Source](https://togithub.com/puppeteer/puppeteer/compare/v17.0.0...v17.1.0)

##### Features

-   **chromium:** roll to Chromium 106.0.5249.0 (r1036745) ([#&#8203;8869](https://togithub.com/puppeteer/puppeteer/issues/8869)) ([6e9a47a](https://togithub.com/puppeteer/puppeteer/commit/6e9a47a6faa06d241dec0bcf7bcdf49370517008))

##### Bug Fixes

-   allow getting a frame from an elementhandle ([#&#8203;8875](https://togithub.com/puppeteer/puppeteer/issues/8875)) ([3732757](https://togithub.com/puppeteer/puppeteer/commit/3732757450b4363041ccbacc3b236289a156abb0))
-   typos in documentation ([#&#8203;8858](https://togithub.com/puppeteer/puppeteer/issues/8858)) ([8d95a9b](https://togithub.com/puppeteer/puppeteer/commit/8d95a9bc920b98820aa655ad4eb2d8fd9b2b893a))
-   use the timeout setting in waitForFileChooser ([#&#8203;8856](https://togithub.com/puppeteer/puppeteer/issues/8856)) ([f477b46](https://togithub.com/puppeteer/puppeteer/commit/f477b46f212da9206102da695697760eea539f05))

### [`v17.0.0`](https://togithub.com/puppeteer/puppeteer/blob/HEAD/CHANGELOG.md#&#8203;1700-httpsgithubcompuppeteerpuppeteercomparev1620v1700-2022-08-26)

[Compare Source](https://togithub.com/puppeteer/puppeteer/compare/v16.2.0...v17.0.0)

#####  BREAKING CHANGES

-   remove `root` from `WaitForSelectorOptions` ([#&#8203;8848](https://togithub.com/puppeteer/puppeteer/issues/8848))
-   internalize execution context ([#&#8203;8844](https://togithub.com/puppeteer/puppeteer/issues/8844))

##### Bug Fixes

-   allow multiple navigations to happen in LifecycleWatcher ([#&#8203;8826](https://togithub.com/puppeteer/puppeteer/issues/8826)) ([341b669](https://togithub.com/puppeteer/puppeteer/commit/341b669a5e45ecbb9ffb0f28c45b520660f27ad2)), closes [#&#8203;8811](https://togithub.com/puppeteer/puppeteer/issues/8811)
-   internalize execution context ([#&#8203;8844](https://togithub.com/puppeteer/puppeteer/issues/8844)) ([2f33237](https://togithub.com/puppeteer/puppeteer/commit/2f33237d0443de77d58dca4454b0c9a1d2b57d03))
-   remove `root` from `WaitForSelectorOptions` ([#&#8203;8848](https://togithub.com/puppeteer/puppeteer/issues/8848)) ([1155c8e](https://togithub.com/puppeteer/puppeteer/commit/1155c8eac85b176c3334cc3d98adfe7d943dfbe6))
-   remove deferred promise timeouts ([#&#8203;8835](https://togithub.com/puppeteer/puppeteer/issues/8835)) ([202ffce](https://togithub.com/puppeteer/puppeteer/commit/202ffce0aa4f34dba35fbb8e7d740af16efee35f)), closes [#&#8203;8832](https://togithub.com/puppeteer/puppeteer/issues/8832)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gaxios).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNzYuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4yIn0=-->
0606166

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

gaxios

npm version codecov Code Style: Google

An HTTP request client that provides an axios like interface over top of node-fetch.

Install

$ npm install gaxios

Example

const {request} = require('gaxios');
const res = await request({
  url: 'https://www.googleapis.com/discovery/v1/apis/'
});

Setting Defaults

Gaxios supports setting default properties both on the default instance, and on additional instances. This is often useful when making many requests to the same domain with the same base settings. For example:

const gaxios = require('gaxios');
gaxios.instance.defaults = {
  baseURL: 'https://example.com'
  headers: {
    Authorization: 'SOME_TOKEN'
  }
}
gaxios.request({url: '/data'}).then(...);

Note that setting default values will take precedence over other authentication methods, i.e., application default credentials.

Request Options

{
  // The url to which the request should be sent.  Required.
  url: string,

  // The HTTP method to use for the request.  Defaults to `GET`.
  method: 'GET',

  // The base Url to use for the request. Prepended to the `url` property above.
  baseURL: 'https://example.com';

  // The HTTP methods to be sent with the request.
  headers: { 'some': 'header' },

  // The data to send in the body of the request. Data objects will be
  // serialized as JSON.
  //
  // Note: if you would like to provide a Content-Type header other than
  // application/json you you must provide a string or readable stream, rather
  // than an object:
  // data: JSON.stringify({some: 'data'})
  // data: fs.readFile('./some-data.jpeg')
  data: {
    some: 'data'
  },

  // The max size of the http response content in bytes allowed.
  // Defaults to `0`, which is the same as unset.
  maxContentLength: 2000,

  // The max number of HTTP redirects to follow.
  // Defaults to 100.
  maxRedirects: 100,

  // The querystring parameters that will be encoded using `qs` and
  // appended to the url
  params: {
    querystring: 'parameters'
  },

  // By default, we use the `querystring` package in node core to serialize
  // querystring parameters.  You can override that and provide your
  // own implementation.
  paramsSerializer: (params) => {
    return qs.stringify(params);
  },

  // The timeout for the HTTP request. Defaults to 0.
  timeout: 1000,

  // Optional method to override making the actual HTTP request. Useful
  // for writing tests and instrumentation
  adapter?: async (options, defaultAdapter) => {
    const res = await defaultAdapter(options);
    res.data = {
      ...res.data,
      extraProperty: 'your extra property',
    };
    return res;
  };

  // The expected return type of the request.  Options are:
  // json | stream | blob | arraybuffer | text
  // Defaults to `json`.
  responseType: 'json',

  // The node.js http agent to use for the request.
  agent: someHttpsAgent,

  // Custom function to determine if the response is valid based on the
  // status code.  Defaults to (>= 200 && < 300)
  validateStatus: (status: number) => true,

  // Implementation of `fetch` to use when making the API call. By default,
  // will use the browser context if available, and fall back to `node-fetch`
  // in node.js otherwise.
  fetchImplementation?: typeof fetch;

  // Configuration for retrying of requests.
  retryConfig: {
    // The number of times to retry the request.  Defaults to 3.
    retry?: number;

    // The number of retries already attempted.
    currentRetryAttempt?: number;

    // The HTTP Methods that will be automatically retried.
    // Defaults to ['GET','PUT','HEAD','OPTIONS','DELETE']
    httpMethodsToRetry?: string[];

    // The HTTP response status codes that will automatically be retried.
    // Defaults to: [[100, 199], [429, 429], [500, 599]]
    statusCodesToRetry?: number[][];

    // Function to invoke when a retry attempt is made.
    onRetryAttempt?: (err: GaxiosError) => Promise<void> | void;

    // Function to invoke which determines if you should retry
    shouldRetry?: (err: GaxiosError) => Promise<boolean> | boolean;

    // When there is no response, the number of retries to attempt. Defaults to 2.
    noResponseRetries?: number;

    // The amount of time to initially delay the retry, in ms.  Defaults to 100ms.
    retryDelay?: number;
  },

  // Enables default configuration for retries.
  retry: boolean,

  // Cancelling a request requires the `abort-controller` library.
  // See https://github.com/bitinn/node-fetch#request-cancellation-with-abortsignal
  signal?: AbortSignal
}

License

Apache-2.0

About

An HTTP request client that provides an axios like interface over top of node-fetch. Super lightweight. Supports proxies and all sorts of other stuff.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published