openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ][CSharp] Should API endpoints accept an additional parameter for specifying custom HTTP headers?

Open starshinata opened this issue 4 years ago • 1 comments

Description

Looking at the endpoints generated from the api.mustache template, there doesn't seem to be a way of passing custom HTTP headers as part of a request. The plan is to modify the mustache template by adding an optional parameter for specifying custom headers when making an API call.

Additional context

Adding this functionality to the C# API template will bring it in line with other language client generators, e.g. the python-legacy one, which already has this feature.

starshinata avatar Jun 27 '22 11:06 starshinata

I am using an API that besides using two ApiKeyTokens also at times needs an additional header added. There is no obvious way to add such headers to a request and that is annoying. I haven't tried yet, but it seems like I have to inherit from HttpClient, but I don't know how to pass information to it yet.

bme-cgm avatar Jan 23 '26 13:01 bme-cgm