class Line::Bot::Client

Public Instance Methods

put(endpoint_base,endpoint_path, payload = nil,headers={}) click to toggle source
# File lib/line_liff.rb, line 35
def put(endpoint_base,endpoint_path, payload = nil,headers={})
  if defined?(Line::Bot::Request)
    if self.class.method_defined? :credentials?
      raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
    else
      channel_token_required
    end
    request = Line::Bot::Request.new do |config|
      config.httpclient     = httpclient
      config.endpoint       = endpoint_base
      config.endpoint_path  = endpoint_path
      config.credentials    = credentials
      config.payload        = payload if payload
    end
      
    return request.put
  else
    headers = Line::Bot::API::DEFAULT_HEADERS.merge(headers)
    httpclient.put(endpoint_base + endpoint_path, payload, headers)
  end
end