-
Notifications
You must be signed in to change notification settings - Fork 5k
Missing ObjectContent class in System.Net.Http #16538
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
Comments
The set of *Content classes in HttpClient is the same as .NET Framework. ASP.NET WebAPI did have a set of extension classes with JSON formatting. cc: @danroth27 |
Ah, thanks I see now. After reading aspnet/Mvc#1639, I added a reference to Microsoft.Aspnet.WebApi.Client package and it now works even though that package doesn't explicitly target .net core. Will that package be updated to target .net core? |
The ASP.NET team can answer that question better. Feel free to open an issue on the aspnet/mvc repo. |
Can you tell me , what should I replace the Content = new ObjectContent<ClubUserDto>(user, new JsonMediaTypeFormatter(), "application/json") in .net core now? |
The ASP.NET team owns the libraries that contain the Please follow up with @danroth27. I also suggest you ask this question in the ASP.NET repo: |
@Eilon @dougbu I believe the work is pretty much done. We are just waiting to align the release with the next update of ASP.NET Web API 2. You can grab the latest build of the package from http://myget.org/gallery/aspnetwebstacknightly. |
Yup I think we're very close to getting this out. We have most of the legwork done, and in the meantime you can try out the nightly package feed to see that it resolves the issues you have with .NET Core support. |
Try to use JsonSerializer + StringContent |
For anyone interested, you can add a reference to the .net standard compatible Microsoft.AspNet.WebApi.Client v5.2.4 which is not released yet because reasons. See aspnet/Mvc#5822 |
We plan to release Microsoft.AspNet.WebApi.Client 5.2.4 in the next month or so pending final verification. |
It appears
ObjectContent
didn't make it among the various subclasses ofHttpContent
(StreamContent
,StringContent
, etc.). Is this a bug or is there another way to useHttpClient
to POST json somewhere?e.g.
The text was updated successfully, but these errors were encountered: