This message was deleted.
# ask-ai
s
This message was deleted.
k
To set custom request headers such as
Accept: application/json
and
Xero-Tenant-Id: "{{ config['tenant_id'] }}"
in Airbyte's config-based connector, you should use the
request_headers
field within the
HttpRequester
component. This is the standard and recommended way to define non-auth headers for outgoing HTTP requests. Your example is already following the correct approach. Here’s how you would define it in your YAML configuration:
Copy code
yaml request_headers:   Accept: application/json   Xero-Tenant-Id: "{{ config['tenant_id'] }}"
This leverages Airbyte's built-in templating with Jinja, allowing you to dynamically inject the
tenant_id
from the connector configuration. There is no further optimization needed, as this is the intended and efficient way to set static and dynamic headers in Airbyte connectors. Authentication headers, if present, will automatically override any overlapping keys as per Airbyte's design [HttpRequester object reference](https://docs.airbyte.com/platform/next/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/HttpRequester). So, your current usage is optimal and aligns with Airbyte's best practices.