Class: FusionAuth::FormDataBodyHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/fusionauth/rest_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body_object) ⇒ FormDataBodyHandler

Returns a new instance of FormDataBodyHandler.



305
306
307
# File 'lib/fusionauth/rest_client.rb', line 305

def initialize(body_object)
  @body = body_object
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



303
304
305
# File 'lib/fusionauth/rest_client.rb', line 303

def body
  @body
end

#lengthObject

Returns the value of attribute length.



303
304
305
# File 'lib/fusionauth/rest_client.rb', line 303

def length
  @length
end

Instance Method Details

#body_objectObject



309
310
311
# File 'lib/fusionauth/rest_client.rb', line 309

def body_object
  @body
end

#set_headers(headers) ⇒ Object

Sets any headers necessary for the body to be processed.

Parameters:

  • headers (Hash)

    The headers hash to add any headers needed by this BodyHandler

Returns:

  • (Object)

    The object



322
323
324
325
# File 'lib/fusionauth/rest_client.rb', line 322

def set_headers(headers)
  headers['Content-Type'] = 'application/x-www-form-urlencoded'
  nil
end

#typeObject



313
314
315
# File 'lib/fusionauth/rest_client.rb', line 313

def type
  "FormData"
end