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

on Jul 03, 2019 03:17 PM

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?

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Jul 03, 2019 03:17 PM
Hi @vorkow,
Please try the following

Twitter OAUTH API: The remote server returned an error: (401) Unauthorized.

It might help you.

Cheers Andrea.