Sha256: 91ba620fb5a96e42149c8a1ce33fd9beeba92ad28a319e62b5220b30e9ef8b9f

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

module Ethon
  module Easies
    module Http
      module Postable
        # Set things up when form is provided.
        # Deals with multipart forms.
        #
        # @example Setup.
        #   post.set_form(easy)
        #
        # @param [ Easy ] easy The easy to setup.
        def set_form(easy)
          easy.url ||= url
          if form.multipart?
            form.escape = false
            form.materialize
            easy.httppost = form.first.read_pointer
          else
            form.escape = true
            easy.copypostfields = form.to_s
            easy.postfieldsize = easy.copypostfields.bytesize
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ethon-0.0.2 lib/ethon/easies/http/postable.rb
ethon-0.0.1 lib/ethon/easies/http/postable.rb