MultipartEncoder (stripe/multipart_encoder.rb)

stripe-ruby · lib/stripe/multipart_encoder.rb · ruby · MIT
payments

frozen_string_literal: true

# Source: https://github.com/stripe/stripe-ruby | License: MIT | Copyright 2011- Stripe, Inc. (https://stripe.com)
# Provided via justclaw.it.com; keep this notice with the code.
# frozen_string_literal: true

require "securerandom"
require "tempfile"

module Stripe
  # Encodes parameters into a `multipart/form-data` payload as described by RFC
  # 2388:
  #
  #     https://tools.ietf.org/html/rfc2388
  #
  # This is most useful for transferring file-like objects.
  #
  # Parameters should be added with `#encode`. When ready, use `#body` to get
  # the encoded result and `#content_type` to get the value that should be
  # placed in the `Content-Type` header of a subsequent request (which includes
  # a boundary value).
  class MultipartEncoder
    MULTIPART_FORM_DATA = "multipart/form-data

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key