Created
November 27, 2016 23:19
-
-
Save dudash/157baf53dae9579764c6b5a9e619298e to your computer and use it in GitHub Desktop.
This file contains 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
// 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