Facebook
From Arek, 5 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 361
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Net.Http;
  6. using System.Threading.Tasks;
  7.  
  8. namespace WikiMovier.Services
  9. {
  10.         public class MovieService : IMovie
  11.         {
  12.                 //http://www.omdbapi.com/?i=tt3896198&apikey=2299f21b
  13.  
  14.                 //private string BASE_URL = "http://www.omdbapi.com/";
  15.                 //private string API_KEY = "&apikey=2299f21b";
  16.  
  17.                 //TODO: PUT API KEY TO SECRET JSON.
  18.  
  19.                
  20.  
  21.                 public async Task<string> DownlaodApiDataAsync(string searchQuery)
  22.                 {
  23.                         string _MovieJson;
  24.                         using (HttpClient hc = new HttpClient())
  25.                         {
  26.                                 string justforquery = searchQuery;
  27.                                 //string url = BASE_URL + "?t=" + searchQuery + API_KEY;
  28.                                 string url = "http://www.omdbapi.com/?i=tt3896198";//usunąłem apikey
  29.                                 var Moviejson = await hc.GetStringAsync(url);
  30.                                 _MovieJson = Moviejson;
  31.                         }
  32.  
  33.                         Debug.WriteLine(_MovieJson);
  34.                         return _MovieJson;
  35.                 }
  36.         }
  37. }

Replies to c# service rss

Title Name Language When
Re: c# service Wessel csharp 4 Years ago.