Beispiel #1
0
            IHttpResponse IHttpRequest.GetResponse()
            {
                switch (this.method)
                {
                case HttpMethod.Delete: this.request.Method = Method.DELETE; break;

                case HttpMethod.Get: this.request.Method = Method.GET; break;

                case HttpMethod.Head: this.request.Method = Method.HEAD; break;

                case HttpMethod.Options: this.request.Method = Method.OPTIONS; break;

                case HttpMethod.Post: this.request.Method = Method.POST; break;

                case HttpMethod.Put: this.request.Method = Method.PUT; break;

                default: throw new ArgumentOutOfRangeException("method: " + this.method);
                }

                var r = new RestSharpResponseWrapper(request);

                r.ExecuteWith(this.client);

                return(r);
            }
            IHttpResponse IHttpRequest.GetResponse()
            {
                switch (this.method)
                {
                    case HttpMethod.Delete: this.request.Method = Method.DELETE; break;
                    case HttpMethod.Get: this.request.Method = Method.GET; break;
                    case HttpMethod.Head: this.request.Method = Method.HEAD; break;
                    case HttpMethod.Options: this.request.Method = Method.OPTIONS; break;
                    case HttpMethod.Post: this.request.Method = Method.POST; break;
                    case HttpMethod.Put: this.request.Method = Method.PUT; break;
                    default: throw new ArgumentOutOfRangeException("method: " + this.method);
                }

                var r = new RestSharpResponseWrapper(request);
                r.ExecuteWith(this.client);

                return r;
            }