Method: Webhookdb::Http.get

Defined in:
lib/webhookdb/http.rb

.get(url, query = {}, **options) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/webhookdb/http.rb', line 63

def self.get(url, query={}, **options, &)
  self._setup_required_args(options)
  opts = {query:, headers: {}}.merge(**options)
  opts[:headers]["User-Agent"] = self.user_agent
  # See https://github.com/jnunemaker/httparty/issues/784#issuecomment-1585714745
  # I *think* this should be safe to always use.
  opts[:headers]["Connection"] ||= "keep-alive"
  r = HTTParty.get(url, **opts, &)
  self.check!(r, **opts)
  return r
end