//----------------------------------------------------------------------- // // The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // // Stubbfel // 15.10.2013 // Implements the HTTP request class //----------------------------------------------------------------------- namespace CampusAppWP8ScheduledTaskAgent.Utility { using System; using System.Net; using CampusAppWPortalLib8.Utility; /// Class realize the access of restful HttpRequest. /// Stubbfel, 15.10.2013. /// public class HttpRequest : AbstractHttpRequest { #region Constructor /// Initializes a new instance of the class. /// Stubbfel, 15.10.2013. public HttpRequest() { } /// Initializes a new instance of the class. /// Stubbfel, 15.10.2013. /// the url of the HttpRequest base address. public HttpRequest(Uri apiBaseAddress) { this.BaseAddress = apiBaseAddress.AbsoluteUri; } #endregion #region Methods /// Method realize the http-get-method resource. /// Stubbfel, 15.10.2013. /// Url of the resource. /// callback method. public void HttpGet(Uri url, Action action) { WebClient client = new WebClient(); client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(action); client.DownloadStringAsync(url); } #endregion } }