aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert2017-07-23 22:56:12 +0200
committerRobert2017-07-25 21:31:51 +0200
commitfe46c7832fa1e0c6af450f0937aea3534c0f6b01 (patch)
tree60670a6ac730a081c3627f25a44c0bd78ea90d3a /lib
parent384a06676b8e0985f39fbc894a2d7dd458823529 (diff)
downloadchouette-core-fe46c7832fa1e0c6af450f0937aea3534c0f6b01.tar.bz2
Refs: #3507;20h Specing and Implementing the ZipService
Diffstat (limited to 'lib')
-rw-r--r--lib/af83/http_fetcher.rb21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/af83/http_fetcher.rb b/lib/af83/http_fetcher.rb
deleted file mode 100644
index 514dd1dc9..000000000
--- a/lib/af83/http_fetcher.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-module AF83
- class HTTPFetcher
- def self.get_resource(*args)
- new.get_resource(*args)
- end
-
- def get_resource(host:, path:, token: nil, params: {}, parse_json: false)
- Faraday.new(url: host) do |c|
- c.headers['Authorization'] = "Token token=#{token.inspect}" if token
- c.adapter Faraday.default_adapter
-
- resp = c.get path, params
- if resp.status == 200
- return parse_json ? JSON.parse(resp.body) : resp.body
- else
- raise "Error on api request status : #{resp.status} => #{resp.body}"
- end
- end
- end
- end
-end