uri
to a file
# Save the actual Github API response body for `uri` to a `file`
private fun save_actual_response(uri, file: String) do
assert update_responses_cache
var request = new CurlHTTPRequest("{api_url}{sanitize_uri(uri)}")
request.user_agent = actual_api.user_agent
request.headers = actual_api.new_headers
var response = request.execute
if response isa CurlResponseSuccess then
response.body_str.write_to_file(file)
else if response isa CurlResponseFailed then
response.error_msg.write_to_file(file)
else abort
print "Response to `{uri}` saved at `{file}`"
end
lib/github/tests/test_api.nit:135,2--151,4