Open jimisola opened 1 month ago
Hi @jimisola Thank you for using kiota and for reaching out.
You are correct, in dotnet, if a base url is set on the underlying HTTP client, it's used by the request adapter. https://github.com/microsoft/kiota-dotnet/blob/650812d9b598f192e6e55424e327d2bcee49c99a/src/http/httpClient/HttpClientRequestAdapter.cs#L52
This is something that could be fixed by adding a couple of conditions here https://github.com/microsoft/kiota-python/blob/43bff74140a544183a81d4975e936974c2ba8a45/packages/http/httpx/kiota_http/httpx_request_adapter.py#L90
(explicitly passed base URL should take precedence over the one from the underlying http client)
By reading the base url property https://github.com/encode/httpx/blob/1bf1fc0ea8417c8e539914aeafdb48f15591ba75/httpx/_client.py#L268
Is this something you'd like to submit a pull request for provided some guidance?
Hi @baywet
Thanks for confirming the issue.
The fix is normally the easy thing whereas getting to know the project, i.e. how to build, test, do code formatting etc is usually what takes time.
I can have a look at it but I don't know when due to deadlines at work and some involvement in some other open source projects.
What are you generating using Kiota, clients or plugins?
API Client/SDK
In what context or format are you using Kiota?
Nuget tool
Client library/SDK language
Python
Describe the bug
AsyncClient.base_url is not used by HttpxRequestAdapter as expected.
Expected behavior
HttpxRequestAdapter uses HttpxRequestAdapter.http_client.base_url
How to reproduce
See above.
Open API description file
No response
Kiota Version
1.18.0
Latest Kiota version known to work for scenario above?(Not required)
No response
Known Workarounds
Set base_url in
Configuration
Debug output
Click to expand log
```Other information
We are using microsoft-kiota-http==1.3.3 (HttpxRequestAdapter). I updated to 1.3.4 but the constructor of HttpxRequestAdapter has not changed from what I can see.
See: https://github.com/microsoft/kiota-http-python/blob/main/kiota_http/httpx_request_adapter.py#L90