Class: AFHTTPClient

Inherits:
Object
  • Object
show all
Defined in:
lib/afmotion/http_client.rb

Instance Method Summary collapse

Instance Method Details

#authorization=(options = {}) ⇒ Object

options can be

  • _, password: __

or

  • {token: _ }



153
154
155
156
157
158
159
160
161
162
163
# File 'lib/afmotion/http_client.rb', line 153

def authorization=(options = {})
  if options.nil?
    clearAuthorizationHeader
  elsif options[:username] && options[:password]
    setAuthorizationHeaderWithUsername(options[:username], password: options[:password])
  elsif options[:token]
    setAuthorizationHeaderWithToken(options[:token])
  else
    raise "Not a valid authorization hash: #{options.inspect}"
  end
end

#multipartObject



144
145
146
147
# File 'lib/afmotion/http_client.rb', line 144

def multipart
  @multipart = true
  self
end