@@ -68,6 +68,8 @@ def curb_http_request(uri, method, body, options)
6868 case method
6969 when :post
7070 curl . post_body = body
71+ when :patch
72+ curl . patch_body = body
7173 when :put
7274 curl . put_data = body
7375 end
@@ -82,7 +84,7 @@ def curb_http_request(uri, method, body, options)
8284 curl = setup_request ( uri , nil , options )
8385
8486 case method
85- when :put , :post
87+ when :put , :post , :patch
8688 curl . send ( "http_#{ method } " , body )
8789 else
8890 curl . send ( "http_#{ method } " )
@@ -98,6 +100,8 @@ def curb_http_request(uri, method, body, options)
98100 case method
99101 when :post
100102 curl . post_body = body
103+ when :patch
104+ curl . patch_body = body
101105 when :put
102106 curl . put_data = body
103107 when :head
@@ -114,7 +118,7 @@ def curb_http_request(uri, method, body, options)
114118 module ClassNamedHttp
115119 def curb_http_request ( uri , method , body , options )
116120 args = [ "http_#{ method } " , uri ]
117- args << body if method == : post || method == :put
121+ args << body if %i[ patch put post ] . include? ( method )
118122
119123 c = Curl ::Easy . send ( *args ) do |curl |
120124 setup_request ( uri , curl , options )
@@ -127,14 +131,16 @@ def curb_http_request(uri, method, body, options)
127131 module ClassPerform
128132 def curb_http_request ( uri , method , body , options )
129133 args = [ "http_#{ method } " , uri ]
130- args << body if method == : post || method == :put
134+ args << body if %i[ patch put post ] . include? ( method )
131135
132136 c = Curl ::Easy . send ( *args ) do |curl |
133137 setup_request ( uri , curl , options )
134138
135139 case method
136140 when :post
137141 curl . post_body = body
142+ when :patch
143+ curl . patch_body = body
138144 when :put
139145 curl . put_data = body
140146 when :head
0 commit comments