Module: Ethon::Easy::Http::Putable

Included in:
Put
Defined in:
lib/ethon/easy/http/putable.rb

Overview

This module contains logic about setting up a PUT body.

Instance Method Summary collapse

Instance Method Details

#set_form(easy) ⇒ Object

Set things up when form is provided. Deals with multipart forms.

Examples:

Setup.

put.set_form(easy)

Parameters:

  • easy (Easy)

    The easy to setup.



15
16
17
18
19
20
21
# File 'lib/ethon/easy/http/putable.rb', line 15

def set_form(easy)
  easy.upload = true
  form.escape = true
  form.params_encoding = params_encoding
  easy.infilesize = form.to_s.bytesize
  easy.set_read_callback(form.to_s)
end