Skip to content

Instantly share code, notes, and snippets.

@dudash
Created November 27, 2016 23:19
Show Gist options
  • Save dudash/157baf53dae9579764c6b5a9e619298e to your computer and use it in GitHub Desktop.
Save dudash/157baf53dae9579764c6b5a9e619298e to your computer and use it in GitHub Desktop.
// Make a call to a cloud REST endpoint (be sure enclosing func is marked async)
String helloName = "emptyItem";
if (item != null && item.Name != null) { helloName = item.Name; }
Console.WriteLine("Calling Cloud.....");
var response = await FH.Cloud("hello", "GET", null, new Dictionary<string, string>() { { "hello", helloName } });
if (response == null)
{
Console.WriteLine("EXCEPTION!");
}
else if (response.Error == null)
{
Console.WriteLine("cloudCall - success");
Console.WriteLine((string)response.GetResponseAsDictionary()["msg"]);
}
else
{
Console.WriteLine("cloudCall - fail");
Console.WriteLine(response.Error.Message, response.Error);
Console.WriteLine(response.Error.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment