Hi all! I need pointed in the right direction with something. In C# on .Net 4.5, I need to send JSON to a REST API via an HTTP POST (running Windows on .Net 4.5 also). The JSON details a single entity; the structure never changes.
"B": " string ",
"1": " string ",
"2": " string ",
"3": " string ",
"a":" string ",
"b":" string ",
"c":" string "
The REST API responds back to the client with JSON. This is part of a server deployment the client is running from, which is a one time action for the life of that server. So client performance is not an issue. I will have to build in other logic to allow for a retry if the REST API doesn’t return the object in a timely fashion. Let’s say it will retry every 60 seconds for a few minutes before eventually timing out.
I’m looking for two things.
1) What class should I use to make the connection to the REST API.
2) Should I bother with anything other than a regular expression if the JSON strings I send over will always be formatted the same?
Thoughts on going about this, and do you have a sample or some webpages you can point me to? I want to avoid using non-Microsoft shipped code if possible. Using the HttpClient seems like a really good option; http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client
. But then there is WebRequest.. http://msdn.microsoft.com/en-us/library/debx8sh9(v=vs.110).aspx
I’m a fairly novice programmer outside of some medium level scripting. I’m not looking for anything too fancy.