示例#1
0
 public IEnumerable <City> GetCity(string suggestion)
 {
     return(JsonClient.Get <City[]>($"/Suggestions?query={suggestion}&maxChoices=50"));
 }
示例#2
0
        public ActionResult GetProducts()
        {
            var collection = _jsonClient.Get <List <ApiResponseProduct> >(ApiEndpoint.DefaultApi + "api/v1/products");

            return(Json(collection ?? new List <ApiResponseProduct>(), JsonRequestBehavior.AllowGet));
        }
 private static VersionJson GetVersion(IJsonClient restClient, Uri appRoot)
 {
     return(restClient.Get <VersionJson>(
                $"{appRoot}__version.js",
                useDefaultCredentials: true));
 }
 private static IEnumerable <HealthCheck> GetChecks(IJsonClient restClient, Uri check)
 {
     return(restClient.Get <IEnumerable <HealthCheck> >(check.ToString(),
                                                        useDefaultCredentials: true));
 }
示例#5
0
 public static string Random()
 {
     return(HttpUtility.HtmlDecode(JsonClient.Get <Joke>("").Value.Joke));
 }