private bool HasHttpMethodWithBody(HttpMethodOptions httpMethod) { if (httpMethod == HttpMethodOptions.Get || httpMethod == HttpMethodOptions.Copy || httpMethod == HttpMethodOptions.Head || httpMethod == HttpMethodOptions.Purge || httpMethod == HttpMethodOptions.Unlock) { return(false); } return(true); }
private NetRequest CreateRequest(string baseUrl, string referer, HttpMethodOptions methodOptions) { var request = new NetRequest(baseUrl, methodOptions); request.AddParameter(HttpR.CookieKey, _execute12306cnInfo.Cookie, ParameterOptions.HttpHeader); request.AddParameter(HttpR.RefererKey, referer, ParameterOptions.HttpHeader); request.AddParameter(HttpR.UserAgentKey, HttpR.UserAgent, ParameterOptions.HttpHeader); request.AddParameter(HttpR.AcceptKey, HttpR.Accept, ParameterOptions.HttpHeader); request.AddParameter(HttpR.AcceptEncodingKey, HttpR.AcceptEncoding, ParameterOptions.HttpHeader); request.AddParameter(HttpR.AcceptLanguageKey, HttpR.AcceptLanguage, ParameterOptions.HttpHeader); request.AddParameter(HttpR.XRequestedWithKey, HttpR.XRequestedWith, ParameterOptions.HttpHeader); return(request); }
public NetRequest(Uri resource, HttpMethodOptions method) : this(resource.IsAbsoluteUri? resource.AbsolutePath + resource.Query: resource.OriginalString, method) { }
public NetRequest(string resource, HttpMethodOptions method) : this() { Resource = resource; Method = method; }
public NetRequest(HttpMethodOptions method) : this() { Method = method; }