27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/roadforest/http/graph-transfer.rb', line 27
def make_request(method, url, graph, retry_limit=5)
= {"Accept" => type_handling.parsers.types.}
body = nil
if(%w{POST PUT PATCH}.include? method.upcase)
content_type = best_type_for(url)
renderer = type_handling.choose_renderer(content_type)
["Content-Type"] = renderer.
body = renderer.from_graph(url, graph)
end
response = user_agent.make_request(method, url, , body, retry_limit)
case response.status
when 415 (url, response.["Accept"])
raise Retryable
end
build_response(url, response)
rescue Retryable
raise unless (retry_limit -= 1) > 0
retry
end
|