zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
167 stars 38 forks source link

.net core has new behavior for returning string, different from .net web api #26

Closed zijianhuang closed 6 years ago

zijianhuang commented 6 years ago

as described at https://github.com/aspnet/Mvc/issues/4945

And the content type becomes text/plain, rather than json

zijianhuang commented 6 years ago

It will be up to the application programmers to either alter the Accept headers of HttpClient, or alter the behavior of .NET Core Web API. For example:

httpClient = new System.Net.Http.HttpClient();
httpClient.DefaultRequestHeaders
      .Accept
      .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
zijianhuang commented 6 years ago

StringAsString option