Exemplo n.º 1
0
 public async Task<Response> ExecuteRequestAsync(Request request)
 {
     return await Task.Run<Response>(() =>
     {
         return ExecuteRequest(request);
     });
 }
Exemplo n.º 2
0
        public Response ExecuteRequest(Request request)
        {
            if (request.Headers == null)
            {
                request.Headers = new Dictionary<string, string>();
            }

            if (!request.Headers.ContainsKey("Authorization") && Authorization != null)
            {
                request.Headers.Add("Authorization", Authorization);
            }

            if (!request.Uri.IsAbsoluteUri)
            {
                request.Uri = new Uri(Baseuri, request.Uri);
            }

            if (request.Timeout == default(int))
            {
                // Default HttpWebRequest.Timeout value
                request.Timeout = 100000;
            }

            return _transport.ExecuteRequest(request);
        }