Skip to content

Instantly share code, notes, and snippets.

@berkayakcay
Created September 10, 2016 16:44
Show Gist options
  • Save berkayakcay/3b6ef6d318245300181e2e0a343e607a to your computer and use it in GitHub Desktop.
Save berkayakcay/3b6ef6d318245300181e2e0a343e607a to your computer and use it in GitHub Desktop.
Hürriyet Api C#
try
{
string uri = "https://api.hurriyet.com.tr/v1/newsphotogalleries;
HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest;
request.Method = "GET";
request.Headers.Add("apikey: YOUR_API_KEY");
string stringResponse = string.Empty;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
stringResponse = reader.ReadToEnd();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
throw;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment