Sha256: b0431e4c234881ea8b803d5756625c8aeee1359d548353b4c0fc6ebd45ec46c9

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "uri"

module HTTPX::Transcoder
  module Form
    module_function

    class Encoder
      extend Forwardable

      def_delegator :@raw, :to_s

      def_delegator :@raw, :bytesize

      def initialize(form)
        @raw = URI.encode_www_form(form)
      end

      def content_type
        "application/x-www-form-urlencoded"
      end
    end

    def encode(form)
      Encoder.new(form)
    end
  end
  register "form", Form
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
httpx-0.10.0 lib/httpx/transcoder/form.rb