lib/httpx/request.rb in httpx-0.11.3 vs lib/httpx/request.rb in httpx-0.12.0

- old
+ new

@@ -215,10 +215,20 @@ def inspect "#<HTTPX::Request::Body:#{object_id} " \ "#{unbounded_body? ? "stream" : "@bytesize=#{bytesize}"}>" end # :nocov: + + def respond_to_missing?(meth, *args) + @body.respond_to?(meth, *args) || super + end + + def method_missing(meth, *args, &block) + return super unless @body.respond_to?(meth) + + @body.__send__(meth, *args, &block) + end end def transition(nextstate) case nextstate when :idle @@ -245,10 +255,10 @@ end when :done return if @state == :expect end @state = nextstate - emit(@state) + emit(@state, self) nil end def expects? @headers["expect"] == "100-continue" && @informational_status == 100 && !@response