20 November 2018
08:00:30
sergey
Posts: 0
|
Consuming Web API(s) In ASP.NET Core MVC Application
|
20 November 2018
08:02:43
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
This is call not from ASP.NET Core, but it gives you more information how this could be done: Call a Web API From a .NET Client (C#)
|
20 November 2018
09:02:11
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
This is a console application and very short example: Consuming a WebAPI Service With .NET Core 2.0
|
20 November 2018
09:06:42
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
|
21 November 2018
21:36:05
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
Post to Web Api from C# code:
var client = new System.Net.Http.HttpClient(); var response = client.PostAsync(http://localhost:5000/api/test/30/savedataproperty , new StringContent("{\"Id\":1234}", Encoding.UTF8, "application/json")).Result;
|
21 November 2018
21:40:37
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
Build web APIs with ASP.NET Core
Couple tricks for your Web Api controller to accept not valid POSTs:
services.Configure<ApiBehaviorOptions>(options => { options.SuppressConsumesConstraintForFormFileParameters = true; options.SuppressInferBindingSourcesForParameters = true; options.SuppressModelStateInvalidFilter = true; });
|
24 November 2018
07:09:36
sergey
Posts: 0
|
Re: Consuming Web API(s) In ASP.NET Core MVC Application
|