コード例 #1
0
        internal override PendingsResponse PendingsRequest(string rfc)
        {
            PendingsResponseHandler handler = new PendingsResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                HttpWebRequest request = RequestPendings(rfc);
                return(handler.GetResponse(request));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
コード例 #2
0
 internal override async Task<PendingsResponse> PendingsRequestAsync(string rfc)
 {
     PendingsResponseHandler handler = new PendingsResponseHandler();
     try
     {
         new Validation(Url, User, Password, Token).ValidateHeaderParameters();
         HttpWebRequest request = await this.RequestPendingsAsync(rfc);
         request.ContentType = "application/json";
         request.ContentLength = 0;
         request.Method = WebRequestMethods.Http.Get;
         var headers = await GetHeadersAsync();
         var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
         return await handler.GetResponseAsync(this.Url, headers, $"pendings/{rfc}", proxy);
     }
     catch (Exception e)
     {
         return handler.HandleException(e);
     }
 }
コード例 #3
0
        internal PendingsResponse PendingsRequest(string rfc)
        {
            PendingsResponseHandler handler = new PendingsResponseHandler();
            var request = RequestPendings(rfc);

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                request.ContentType   = "application/json";
                request.ContentLength = 0;
                request.Method        = WebRequestMethods.Http.Get;
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetResponse(Url, headers, $"pendings/{rfc}", proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
コード例 #4
0
 public Pending(string url, string user, string password, int proxyPort = 0, string proxy = null) : base(url, user, password, proxy, proxyPort)
 {
     _handler = new PendingsResponseHandler();
 }
コード例 #5
0
 public Pending(string url, string token, int proxyPort = 0, string proxy = null) : base(url, token, proxy, proxyPort)
 {
     _handler = new PendingsResponseHandler();
 }