def request(http_method, path, token = nil, request_options = {}, *arguments)
if path !~ /^\//
@http = create_http(path)
_uri = URI.parse(path)
path = "#{_uri.path}#{_uri.query ? "?#{_uri.query}" : ""}"
end
rsp = http.request(create_signed_request(http_method, path, token, request_options, *arguments))
if !(headers = rsp.to_hash["www-authenticate"]).nil? &&
(h = headers.select { |h| h =~ /^OAuth / }).any? &&
h.first =~ /oauth_problem/
params = OAuth::Helper.parse_header(h.first)
raise OAuth::Problem.new(params.delete("oauth_problem"), rsp, params)
end
rsp
end