Skip to content

Conversation

@andreaTP
Copy link
Contributor

@andreaTP andreaTP commented Jan 2, 2024

Opening this as PR as it adds to coverage, but the intention is to focus on the HeadersCollection implementation.

request_adapter.base_url = 'http://127.0.0.1:1080'
client = ApiClient(request_adapter)

myHeaders = HeadersCollection()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the nasty detail, it looks like a lot of boilerplate for something that we used to write as:

config = TodosRequestBuilder.TodosRequestBuilderPostRequestConfiguration(
        headers = { "My-Extra-Header", "hello" }
 )

Either we add more helper methods to make the conversion automatic for the user or, at the very least, we should add a constructor from Dict[str, str | List[str]] to HeadersCollection.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

for context to others reading this. It's being discussed here microsoft/kiota-python#208

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

Labels

None yet

Projects

Status: New📃

Development

Successfully merging this pull request may close these issues.

2 participants