You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# other methods: `form_send`, `multipart_form_send`
32
41
# `sort_params` at Faraday gem default is true.
33
42
# `content_type_charset` default is 'utf-8', this will add ; charset=utf-8 after `Content-Type` header (ex. `Content-Type=application/json; charset=utf-8`).
43
+
# `need_response_header` when set to true will include response headers in the result
34
44
res = requester.http_send(http_method, path, params, headers, sort_params:true, content_type_charset:'utf-8')
35
45
36
46
# http response code
37
47
puts res['status'] # 200, 404, .. etc
38
48
# the response JSON body
39
-
puts res['body'] # { foo: 'bar' }
49
+
puts res['body'] # { foo: 'bar' }
50
+
51
+
# If need_response_header is true, you can access response headers
52
+
puts res['headers'] if res.key?('headers')
53
+
54
+
# For form-encoded requests (application/x-www-form-urlencoded)
0 commit comments