Conditions | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | require 'faraday' |
||
15 | def set_client() |
||
16 | headers = { |
||
17 | 'Host' => 'api.medium.com', |
||
18 | 'Authorization' => 'Bearer ' + @token, |
||
19 | 'Content-Type' => 'application/json', |
||
20 | 'Accept' => 'application/json', |
||
21 | 'Accept-Charset' => 'utf-8' |
||
22 | } |
||
23 | @http = Faraday.new(url: @endpoint, headers: headers) do |conn| |
||
24 | conn.request :multipart |
||
25 | conn.request :json |
||
26 | conn.response :json, content_type: 'application/json' |
||
27 | conn.adapter Faraday.default_adapter |
||
28 | end |
||
29 | end |
||
30 | |||
33 |