class Line::Bot::HTTPClient

Public Instance Methods

get(url, header = {}) click to toggle source
# File lib/line/bot/httpclient.rb, line 34
def get(url, header = {})
  uri = URI(url)
  http(uri).get(uri.request_uri, header)
end
http(uri) click to toggle source

@return [Net::HTTP]

# File lib/line/bot/httpclient.rb, line 25
def http(uri)
  http = Net::HTTP.new(uri.host, uri.port)
  if uri.scheme == "https"
    http.use_ssl = true
  end

  http
end
post(url, payload, header = {}) click to toggle source
# File lib/line/bot/httpclient.rb, line 39
def post(url, payload, header = {})
  uri = URI(url)
  http(uri).post(uri.request_uri, payload, header)
end