on-internet
← Community

C# post JSON data to REST API

Stack Overflow ·

I am new to REST API JSON but have been able to consume a few API with asp.net. Here is the problem I am currently facing. I have been able to send JSON data to an API using this method. public void PostData() { string sName = sysName.Text; string sDescrip = sysDescrip.Text; var httpclient = new HttpClient(); httpclient.BaseAddress = new Uri("http://33.248.292.99:8094/bizzdesk/sysconfig/api/"); var sys = new Bizsys(){name= sName, description= sDescrip}; httpclient.PostAsJsonAsync("system", sys); } it work just fine. Now I modify the code in order to accommodate more values thus: var httpclient

Comments

Sign in or sign up to comment and upvote.

No comments yet.