/// <summary> /// Get response /// </summary> /// <param name="readResponse">If read the whole response</param> /// <returns>The response object</returns> public Response GetReponse(bool readResponse) { Response ret = null; HttpWebRequest request = this.HttpRequest; try { ret = new Response((HttpWebResponse)request.GetResponse()); } catch (WebException e) { ret = new Response(e); } finally { if (readResponse && ret != null) { ret.Read(); } } return ret; }