API Custom Headers

You can define custom headers for WhiteHat AutoAPI to use when calling the API. Any custom headers added here will be used on all requests to the API. By default there are five custom headers created when you add an API as an asset. These are:

  • Accept: This custom header is used to specify which media types are acceptable in the response.

  • Accept-Charset: This custom header is used to specify which character sets are acceptable in the response.

  • Accept-Encoding: This custom header is used to specify which content-coding formats are acceptable in the response.

  • Accept-Language: This custom header is used to restrict the set of natural languages that are preferred as a response to the request.

  • User-Agent: This custom header contains information about the user agent originating the request.

Adding Custom Headers

You can add additional custom headers that will be included with any requests to the API, but you cannot edit existing custom headers. If you need to change the field value for an existing custom header, you must delete the existing custom header and then add it as a new custom header with the required field value. To add a custom header:

  1. From the API Configuration screen, click on the Authentication sub-tab.

    api configuration tab custom headers
  2. Under Custom Headers, click Add or click Edit if custom headers already exist.

  3. Provide a value for the Custom Header Name field.

    api custom headers 2
  4. Provide a value for the Custom Header Value field.

  5. Click Save.

Deleting Custom Headers

To delete a custom header:

  1. From the API Configuration screen, click on the Authentication sub-tab.

    api configuration tab custom headers delete
  2. Click the trash icon beside the custom header that you wish to delete.

  3. When prompted, click Confirm in the confirmation dialog window.

    api custom headers delete 2