Questions tagged [system.net.http.json]

3 questions
0
votes
1 answer

C# PowerShell module : System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.3, Culture=neu tral

I'm working on an application with a GUI and a Powershell module in the same solution. On Windows 2008 R2 framework 4.5.2 I have the error message : System.TypeInitializationException: The type initializer for 'ClassName' threw an exception. --->…
Le ZVince
  • 39
  • 7
0
votes
1 answer

Using PostAsJsonAsync in an Azure Function doesn't send the body. Works in WebAPI for .Net 6

When using a http client in an azure function (.Net 6), the body is null when received. Here is what is called: await _httpClient.PostAsJsonAsync(uri, value); If I do the same thing in a web api (same code in .Net 6), it works. Following the…
0
votes
1 answer

How to retrieve the Id of a newly Posted entity using ASP.Net Core?

I Post a new Waste entity using the following code: var result = await httpClient.PostAsJsonAsync(wasteApiRoute, waste); The Api Controller (using the code created by VS) seems to try to make life easy for me by sending back the new Id of the Waste…
Dabblernl
  • 15,831
  • 18
  • 96
  • 148