public void UploadBookFile(string bookId, string fileName, Stream dataStream)
        {
            var commInfo = m_uriCache.GetCommunicationInfoForMethod();

            var uri     = SetParamsToUri(commInfo.UriTemplate, bookId, fileName);
            var content = new StreamContent(dataStream);

            m_existClient.SendRequestGetResponseAsString(commInfo, uri, content).Wait();
        }
Пример #2
0
        public void UploadBookFile(string bookId, string fileName, Stream dataStream)
        {
            var commInfo = m_uriCache.GetCommunicationInfoForMethod();

            var uri     = SetParamsToUri(commInfo.UriTemplate, bookId, fileName);
            var content = new StreamContent(dataStream);

            try
            {
                m_existClient.SendRequestGetResponseAsStringAsync(commInfo, uri, content).Wait();
            }
            catch (AggregateException exception)
            {
                if (m_log.IsErrorEnabled)
                {
                    m_log.Error($"{GetCurrentMethodName()} failed with {exception.GetType().Name}", exception);
                }
                throw;
            }
        }