# File lib/webmock/request_pattern.rb, line 142
    def matches?(body, content_type = "")
      if (@pattern).is_a?(Hash)
        return true if @pattern.empty?

        case BODY_FORMATS[content_type]
        when :json then
          matching_hashes?(WebMock::Util::JSON.parse(body), @pattern)
        when :xml then
          matching_hashes?(Crack::XML.parse(body), @pattern)
        else
          matching_hashes?(Addressable::URI.parse('?' + body).query_values, @pattern)
        end
      else
        empty_string?(@pattern) && empty_string?(body) ||
          @pattern == body ||
          @pattern === body
      end
    end