I am new to c#,can you tell me what is best way to pass json value to API in c# using POST.
Below I have written python code, but not sure how to do it in c#.
string payload = {
"username" : "1432143352759a61bca0ad4a35a4f0", # when you register, they'll return this
"password" : "password",
"client_id" : "c3ca1565b0dbedd74c5c",
"client_secret" : "e0591fe41c4e2585b313ad93e2748022db3186d0",
}
res = requests.post("https://sandbox.synapsepay.com/api/v2/user/login", payload)
print res.status_code
print res.text
From a .NET client (e.g WinForm), you can use HttpClient.
Check out this solution:
http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With