def request(method, url, body=nil) # :nodoc:

      unless ['/', ''].include?(URI::parse(url).path)
        setup_oauth_token
      end

      begin
        raw = connection(current_options.merge({url: url})).send(method) do |req|
          if [:post, :put].include?(method.to_sym) && !body.blank?
            req.body = PMP::CollectionDocument.to_persist_json(body)
          end
        end
      rescue Faraday::Error::ResourceNotFound => not_found_ex
        if (method.to_sym == :get)
          raw = OpenStruct.new(body: nil, status: 404)
        else
          raise not_found_ex
        end
      end

      # may not need this, but remember how we made this response
      PMP::Response.new(raw, {method: method, url: url, body: body})
    end
def request(method, url, body=nil) # :nodoc:

      unless ['/', ''].include?(URI::parse(url).path)
        setup_oauth_token
      end

      begin
        raw = connection(current_options.merge({url: url})).send(method) do |req|
          if [:post, :put].include?(method.to_sym) && !body.blank?
            req.body = PMP::CollectionDocument.to_persist_json(body)
          end
        end
      rescue Faraday::Error::ResourceNotFound => not_found_ex
        if (method.to_sym == :get)
          raw = OpenStruct.new(body: nil, status: 404)
        else
          raise not_found_ex
        end
      end

      # may not need this, but remember how we made this response
      PMP::Response.new(raw, {method: method, url: url, body: body})
    end
url includes any params - full url