Skip to content

Instantly share code, notes, and snippets.

@JoachimL
Created March 19, 2017 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoachimL/88488b77e05a7cec4c993bb3f7921bdd to your computer and use it in GitHub Desktop.
Save JoachimL/88488b77e05a7cec4c993bb3f7921bdd to your computer and use it in GitHub Desktop.
Get kolonial product
public static async Task<KolonialProduct> GetKolonialProductAsync(HttpClient client, string barcode)
{
var httpResult = await client.GetAsync(ConfigurationManager.AppSettings["GetKolonialProductUri"] + "&barcode=" + barcode);
if (httpResult.IsSuccessStatusCode)
{
var json = await httpResult.Content.ReadAsStringAsync();
if (json != null)
return JsonConvert.DeserializeObject<KolonialProduct>(json);
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment