//----------------------------------------------------------------------- // // Company copyright tag. // // stubbfel // 10.06.2013 //---------------------------------------------------------------------- namespace CampusAppWP8ScheduledTaskAgent.Utility { using System; using System.Net; using CampusAppWPortalLib8.Utility; /// /// Class realize the access of restful HttpRequest /// public class HttpRequest : AbstractHttpRequest { #region Constructor /// /// Initializes a new instance of the class. /// public HttpRequest() { } /// /// Initializes a new instance of the class. /// /// 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 /// /// 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 } }