Nswag: (TypeScriptGenerator) Change Http to HttpClient

Created on 21 Sep 2017  路  5Comments  路  Source: RicoSuter/NSwag

[Enhancement]

In a project that uses NSwag we are using JWT based authorization between an Angular SPA and an ASP.Net Core Web Api. The best practice to set the default request header is to use HTTP interceptors and add the header there. See: https://offering.solutions/blog/articles/2017/07/19/angular-2-new-http-interface-with-interceptors/

Currently the injected http client is Http, which doesnt offer the needed features that HttpClient offers. The generated TypeScript client would strongly benefit from the newer HttpClient.

duplicate

Most helpful comment

This is planned and will (hopefully) come soon

All 5 comments

This is planned and will (hopefully) come soon

The docs have been updated: https://github.com/RSuter/NSwag/wiki/SwaggerToTypeScriptClientGenerator#angular

Test with CI builds: https://ci.appveyor.com/project/rsuter/nswag-25x6o

Please report any problems, suggestions, etc. thank you.

image

I just installed the CI NSwagStudio build and tried the new settings. Looks great. Thank you a lot.

Was this page helpful?
0 / 5 - 0 ratings