Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zijianhuang opened this issue May 6, 2018 · 2 comments

Comments

@zijianhuang
Copy link
Owner

as described at aspnet/Mvc#4945

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

@zijianhuang
Copy link
Owner Author

zijianhuang commented May 6, 2018

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
Copy link
Owner Author

StringAsString option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant