<@U06CBKL5W7L> Why is the `http_headers` method he...
# singer-tap-development
h
@aaronsteers Why is the
http_headers
method here not passed the
context
object? https://gitlab.com/meltano/sdk/-/blob/main/singer_sdk/streams/rest.py#L233
a
Originally I don't think we anticipated the context being required to build the headers. And defined as a property, the syntax was self.http_headers without requiring any parameters. Can you say more about the use case where http headers would vary? Is this for varied authentication headers or another application?
Depending on the use case, we could introduce get_http_headers() or some other request method override...
h
Yeah, this might be a quirk with some platforms we integrate with
Specifically, for Procore they require we pass one of the params we have in our partition (
company_id
) as a header as well to help with routing to the correct region on their side
So I need to include a header based on my partition, called
Procore-Company-Id
a
Thanks for explaining the use case and sharing the docs link. Yes, I think a new get_http_headers() similar to get_url_params() would be helpful for this use case. It isn't something we originally planned for but it should be possible without much refactoring. (When not overridden, it could just return what http_headers returns today.)