mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
remove http verb checks, strictness does not benefit experimentation
This commit is contained in:
parent
eb3d3f9048
commit
49d6cc4da4
@ -9,29 +9,6 @@ module HTTPX
|
||||
include Callbacks
|
||||
using URIExtensions
|
||||
|
||||
METHODS = [
|
||||
# RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1
|
||||
:options, :get, :head, :post, :put, :delete, :trace, :connect,
|
||||
|
||||
# RFC 2518: HTTP Extensions for Distributed Authoring -- WEBDAV
|
||||
:propfind, :proppatch, :mkcol, :copy, :move, :lock, :unlock,
|
||||
|
||||
# RFC 3648: WebDAV Ordered Collections Protocol
|
||||
:orderpatch,
|
||||
|
||||
# RFC 3744: WebDAV Access Control Protocol
|
||||
:acl,
|
||||
|
||||
# RFC 6352: vCard Extensions to WebDAV -- CardDAV
|
||||
:report,
|
||||
|
||||
# RFC 5789: PATCH Method for HTTP
|
||||
:patch,
|
||||
|
||||
# draft-reschke-webdav-search: WebDAV Search
|
||||
:search
|
||||
].freeze
|
||||
|
||||
USER_AGENT = "httpx.rb/#{VERSION}"
|
||||
|
||||
attr_reader :verb, :uri, :headers, :body, :state, :options, :response
|
||||
@ -54,8 +31,6 @@ module HTTPX
|
||||
@uri = origin.merge("#{base_path}#{@uri}")
|
||||
end
|
||||
|
||||
raise(Error, "unknown method: #{verb}") unless METHODS.include?(@verb)
|
||||
|
||||
@headers = @options.headers_class.new(@options.headers)
|
||||
@headers["user-agent"] ||= USER_AGENT
|
||||
@headers["accept"] ||= "*/*"
|
||||
|
Loading…
x
Reference in New Issue
Block a user