Module: ActionDispatch::Http::Multipart
- Defined in:
- runtime/action_dispatch/multipart.rbs,
runtime/action_dispatch/multipart.rb
Defined Under Namespace
Classes: Form
Class Method Summary collapse
-
.add_part(form, headers, content) ⇒ void
register one part: its name, whether it is a file, and its bytes.
-
.boundary(content_type) ⇒ String
the boundary parameter of a
multipart/form-data; boundary=…header, unquoted. -
.disposition_param(header, attr) ⇒ String
the value of
<attr>="…"inside a Content-Disposition header. -
.parse(body, content_type) ⇒ Form?
the parts of one multipart body, split into
Form#fields(text) andForm#files.
Class Method Details
.add_part(form, headers, content) ⇒ void
register one part: its name, whether it is a file, and its bytes. The header block is small and ASCII, so character ops are byte ops there.
186 |
# File 'runtime/action_dispatch/multipart.rb', line 186
def self.add_part: (ActionDispatch::Http::Multipart::Form form, String headers, String content) -> void
|
.boundary(content_type) ⇒ String
the boundary parameter of a multipart/form-data; boundary=… header,
unquoted.
112 |
# File 'runtime/action_dispatch/multipart.rb', line 112
def self.boundary: (String content_type) -> String
|
.disposition_param(header, attr) ⇒ String
the value of <attr>="…" inside a Content-Disposition header.
130 |
# File 'runtime/action_dispatch/multipart.rb', line 130
def self.disposition_param: (String header, String attr) -> String
|
.parse(body, content_type) ⇒ Form?
the parts of one multipart body, split into Form#fields (text) and
Form#files. A body that does not parse answers nil instead of the
parts found before it stopped: a missing boundary, a lost delimiter, or
a truncated part means the payload never arrived whole, and the fields
before the break are not the request the client meant. The caller turns
nil into a request failure rather than serving half a form.
150 |
# File 'runtime/action_dispatch/multipart.rb', line 150
def self.parse: (String body, String content_type) -> ActionDispatch::Http::Multipart::Form?
|