Skip to content

Conversation

@Mantisus
Copy link
Collaborator

@Mantisus Mantisus commented Feb 2, 2026

Description

This PR adds the extra_headers argument for ApifyClient and ApifyClientAsync, which allows you to set additional custom headers in the HTTP client. The set headers will be applied to all requests. Custom headers cannot override default headers set in the client.

This solves the problem case described in #416 (comment)

Testing

Tests checking the set headers have been added.

@Mantisus Mantisus self-assigned this Feb 2, 2026
Copy link
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM code-wise, but I can't help but ask, what is the actual problem that this is solving? I went through the linked issue, but I still don't understand why people need to access the Apify API with custom headers. Bear in mind this is just my desire to learn, not being annoying.

@Mantisus
Copy link
Collaborator Author

Mantisus commented Feb 2, 2026

what is the actual problem that this is solving?

I can imagine a working environment where traffic to all external services is proxied, and headers serve as authentication to the proxy.

Bear in mind this is just my desire to learn, not being annoying.

Wasn't thinking that until you mentioned it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants