What is the best way to call an arbitrary JSON server from .NET (Windows Phone 7 specifically)

I have a server that I have no control over, it is based on JSON, and I put together a simple proof of concept that calls the server using HTTPWebRequest etc. and it works fine (if a little verbose since MS removed all synchronous Calls input / output).

Is there a better way to do this? I was looking at WCF as an option, but any stable and sanely working library should do the job. This is a new area for me, so I'm a little unsure what the best practice is (or where to find it).

Thanks in advance Dave

+2


source to share


2 answers


Not sure if this is the best method, but HttpWebRequest plus DataContractJsonSerializer is probably the best approach using classes only from the Windows Phone library - HttpWebRequest asynchronous methods ensure that your code won't block the UI thread when making network requests.



+1


source


Once you've written the http request code once, you can easily abstract it for reuse. You've already done the tricky part :-)



+1


source







All Articles