lib/protocol/http/response.rb in protocol-http-0.26.2 vs lib/protocol/http/response.rb in protocol-http-0.26.3

- old
+ new

@@ -102,9 +102,19 @@ def self.for_exception(exception) Response[500, Headers['content-type' => 'text/plain'], ["#{exception.class}: #{exception.message}"]] end + def as_json + { + version: @version, + status: @status, + headers: @headers&.as_json, + body: @body&.as_json, + protocol: @protocol + } + end + def to_s "#{@status} #{@version}" end def to_ary