Questions tagged [httpcontent]

79 questions
-1
votes
1 answer

ReadAsAsync cast custom class return null for .net core

I have a old MVC program, converting to .net core. but I am facing ReadAsAsync() casting issue. Same code worked on old MVC, but not .NET Core. I have a User model: public class User { public int Id { get; set; } public string Username {…
Howard Hee
  • 909
  • 1
  • 13
  • 29
-1
votes
1 answer

await vs .Result with HttpContent.ReadAsStringAsync

I have a custom model binder: public class JsonPolyModelBinder : IModelBinder { private readonly JsonSerializerSettings settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto }; public bool…
user3689167
  • 863
  • 1
  • 14
  • 28
-1
votes
1 answer

POST data using HttpClient

I'm trying to POST a data to web using HttpClient but i can't succeed. Here is my JSON web api { "Categories":[ { "CategoryID":1, "Category":"Category 1" }, { "CategoryID":2, …
Naeem Shah
  • 115
  • 1
  • 1
  • 12
-2
votes
0 answers

Sending a file signed in SHA256 to HttpContent to the WEB API

I sign a file with a secure digital signature using SHA256 technology and then want to send the file in C# code to the WEB API according to FILESTREAM The problem is that the file goes wrong, what can solve the problem? This is my code: public…
D Tz
  • 1
1 2 3 4 5
6