-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Labels
CsharpPull requests that update .net codePull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:featureNew experience requestNew experience request
Description
Is your feature request related to a problem? Please describe the problem.
Sometimes Kiota doesn't handle certain scenarios or generates incorrect "stuff" for an endpoint.
In these cases it would be handy to be able to access the HttpClient Kiota uses so we can manually make the request.
I'm expecting the HttpClient we get from Kiota to have the configured baseurl and authentication.
Client library/SDK language
Csharp
Describe the solution you'd like
public async Task GetAsync()
{
// doesn't work - waiting on #7147
// await _client.Tests.GetAsync(x => x.Headers.Add(HeaderNames.Accept, MediaTypeNames.Application.Octet));
// workaround until fixed
var httpClient = _client.HttpClient;
// DefaultRequestHeaders might not be correct usage
httpClient.DefaultRequestHeaders.Add(HeaderNames.Accept, MediaTypeNames.Application.Octet);
var stream = await httpClient.GetStreamAsync("/tests");
...
}Additional context
If DefaultRequestHeaders isn't the correct way to use the http client from Kiota then please make it easy to add headers to a single request.
Using HttpRequestMessage and SendAsync is tedious :)
Metadata
Metadata
Assignees
Labels
CsharpPull requests that update .net codePull requests that update .net codestatus:waiting-for-triageAn issue that is yet to be reviewed or assignedAn issue that is yet to be reviewed or assignedtype:featureNew experience requestNew experience request
Type
Projects
Status
Needs Triage 🔍