Created
March 17, 2014 20:02
-
-
Save adamsteinert/9607056 to your computer and use it in GitHub Desktop.
Get a ResponseBase<T> from a web service via JSON.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
using Newtonsoft.Json.Linq; | |
//... | |
using (var w = new WebClient()) | |
{ | |
var json_data = string.Empty; | |
var fullUrl = commandUrl + key; | |
json_data = w.DownloadString(fullUrl); | |
var package = JObject.Parse(json_data).ToObject<ResponseBase<ClientConfigPackage>>(); | |
if(!package.Success) | |
this.YsLog(package.Error); | |
return package; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment