예제 #1
0
        internal virtual HttpWebRequest RequestAcceptReject(string rfc, string uuid, EnumAcceptReject enumAcceptReject)
        {
            this.SetupRequest();
            string path    = string.Format("acceptreject/{0}/{1}/{2}", rfc, uuid, enumAcceptReject.ToString());
            var    request = (HttpWebRequest)WebRequest.Create(this.Url + path);

            request.ContentType   = "application/json";
            request.ContentLength = 0;
            request.Method        = WebRequestMethods.Http.Post;
            request.Headers.Add(HttpRequestHeader.Authorization.ToString(), "bearer " + this.Token);
            Helpers.RequestHelper.SetupProxy(this.Proxy, this.ProxyPort, ref request);
            return(request);
        }
        internal virtual HttpWebRequest RequestAcceptReject(string rfc, string uuid, EnumAcceptReject enumAcceptReject)
        {
            SetupRequest();
            string path    = $"acceptreject/{rfc}/{uuid}/{enumAcceptReject.ToString()}";
            var    request = (HttpWebRequest)WebRequest.Create(Url + path);

            request.ContentType   = "application/json";
            request.ContentLength = 0;
            request.Method        = WebRequestMethods.Http.Post;
            request.Headers.Add(HttpRequestHeader.Authorization.ToString(), "bearer " + Token);
            RequestHelper.SetupProxy(Proxy, ProxyPort, ref request);
            return(request);
        }
예제 #3
0
        internal override AcceptRejectResponse AcceptRejectRequest(string rfc, string uuid, EnumAcceptReject enumAcceptReject)
        {
            AcceptRejectResponseHandler handler = new AcceptRejectResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                HttpWebRequest request = RequestAcceptReject(rfc, uuid, enumAcceptReject);
                request.ContentType   = "application/json";
                request.ContentLength = 0;
                request.Method        = WebRequestMethods.Http.Post;
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetPostResponse(Url, headers, $"acceptreject/{rfc}/{uuid}/{enumAcceptReject.ToString()}", proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }