Beispiel #1
0
        /// <summary>
        /// Downloads a chuck of the update based on the offset.
        /// </summary>
        /// <param name="request">The request to download the chuck for..</param>
        /// <returns>A chuck of the update starting from the update.</returns>
        public byte[] DownloadUpdateChunk(WindowsServiceUpdateRequest request)
        {
            if (_credentials != null)
            {
                Login(_credentials);
            }

            using (var response = _client.Post("DownloadUpdateChunk", request))
            {
                CheckResponse(response);

                using (var content = response.Content)
                {
                    return(JsonConvert.DeserializeObject <byte[]>(content.ReadAsStringAsync().Result));
                }
            }
        }
Beispiel #2
0
 public byte[] DownloadUpdateChunk([FromBody] WindowsServiceUpdateRequest request)
 {
     return(_service.DownloadUpdateChunk(request));
 }