Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify making a post in Python configuring the headers #3962

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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: Todo 📃
Development

Successfully merging this pull request may close these issues.

2 participants