axios#HeadersDefaults TypeScript Examples

The following examples show how to use axios#HeadersDefaults. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HTTP.ts    From fnbr.js with MIT License 6 votes vote down vote up
/**
   * @param {Client} client The main client
   */
  constructor(client: Client) {
    super(client);

    this.options = {
      ...this.client.config.http,
    };

    this.axios = axios.create(this.options);

    // Clear all default content type headers
    (Object.keys(this.axios.defaults.headers) as (keyof HeadersDefaults)[]).forEach((h) => {
      delete this.axios.defaults.headers[h]?.['Content-Type'];
    });
  }