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.



334
335
336
# File 'lib/fusionauth/rest_client.rb', line 334

def initialize(body_object)
  @body = body_object
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



332
333
334
# File 'lib/fusionauth/rest_client.rb', line 332

def body
  @body
end

#lengthObject

Returns the value of attribute length.



332
333
334
# File 'lib/fusionauth/rest_client.rb', line 332

def length
  @length
end

Instance Method Details

#body_objectObject



338
339
340
# File 'lib/fusionauth/rest_client.rb', line 338

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



351
352
353
354
# File 'lib/fusionauth/rest_client.rb', line 351

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

#typeObject



342
343
344
# File 'lib/fusionauth/rest_client.rb', line 342

def type
  "FormData"
end