Class Ethon::Easy::Form
In: lib/ethon/easy/form.rb
Parent: Object

This class represents a form and is used to send a payload in the request body via POST/PUT. It handles multipart forms, too.

@api private

Methods

first   last   materialize   multipart?   new  

Included Modules

Ethon::Easy::Util Ethon::Easy::Queryable

Public Class methods

Return a new Form.

@example Return a new Form.

  Form.new({})

@param [ Hash ] params The parameter with which to initialize the form.

@return [ Form ] A new Form.

Public Instance methods

Return a pointer to the first form element in libcurl.

@example Return the first form element.

  form.first

@return [ FFI::Pointer ] The first element.

Return a pointer to the last form element in libcurl.

@example Return the last form element.

  form.last

@return [ FFI::Pointer ] The last element.

Add form elements to libcurl.

@example Add form to libcurl.

  form.materialize

Return if form is multipart. The form is multipart when it contains a file or multipart option is set on the form during creation.

@example Return if form is multipart.

  form.multipart?

@return [ Boolean ] True if form is multipart, else false.

[Validate]