WebClient.UploadString Error: Remote server returned error: (500) Internal server error

Last Reply one month ago By dharmendr

Posted one month ago

I am reviewing an example from the article "Calling (using) a web API in a Windows Forms application using C #" link

Call (Consume) Web API in Windows Forms Application using C#

In the "PopulateDataGridView ()" method, the string "string json = client.UploadString (apiUrl +" / GetCustomers ", inputJson);"
 

I get an error: "Remote server returned error: (500) Internal server error.
 
in System.Net.WebClient.UploadDataInternal (Uri address, String method, Byte [] data, WebRequest & request)

in System.Net.WebClient.UploadString (Uri address, String method, String data)

in System.Net.WebClient.UploadString (String address, String data)

in WebAPI_Windows_Client.Form1.PopulateDataGridView () in Z: \ vs \ csharp \ prb \ WebAPI_Windows_Client \ Form1.cs: line 47"

How to fix the error?

You are viewing reply posted by: dharmendr one month ago.