/// <summary> /// Downloads the client report. /// </summary> /// <param name="downloadUrl">The download URL.</param> /// <param name="postBody">The HTTP POST request body.</param> /// <param name="path">The path to which report should be downloaded. /// </param> /// <returns>The client report.</returns> private ClientReport GetClientReportInternal(string downloadUrl, string postBody) { MemoryStream memStream = new MemoryStream(); DownloadReportToStream(downloadUrl, postBody, memStream); ClientReport retval = new ClientReport(); retval.Contents = memStream.ToArray(); return(retval); }
/// <summary> /// Downloads the client report. /// </summary> /// <param name="downloadUrl">The download URL.</param> /// <param name="postBody">The HTTP POST request body.</param> /// <param name="path">The path to which report should be downloaded. /// </param> /// <returns>The client report.</returns> private ClientReport DownloadClientReportInternal(string downloadUrl, string postBody, string path) { ClientReport retval = new ClientReport(); using (FileStream fileStream = File.OpenWrite(path)) { fileStream.SetLength(0); DownloadReportToStream(downloadUrl, postBody, fileStream); retval.Path = path; return(retval); } }