public void Download() { var response = webResponse.GetResponse(); if (response is IJsonToXmlTranslatedResponse) { Xml = (response as IJsonToXmlTranslatedResponse).Xml; } }
public void Download() { var response = webResponse.GetResponse(); if (response is IHtmlDocTranslatedResponse) { var htmlDocTransleted = (response as IHtmlDocTranslatedResponse); ProcessDetials(htmlDocTransleted); } }
public string GetWebContent(IRequest <WebRequest, string> request, IWebResponse <WebResponse, WebRequest> response, string website) { //Prints out the status of the website WebRequest webRequest = request.MakeRequest(website); WebResponse webResponse = response.GetResponse(webRequest); Console.WriteLine(((HttpWebResponse)webResponse).StatusDescription); string responseHtml; using (StreamReader responseStream = new StreamReader(webResponse.GetResponseStream())) { responseHtml = responseStream.ReadToEnd().Trim(); } return(responseHtml); }