MultipartBody

An <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>-compliant request body.

Constructors

this
this(string boundary, MediaType type, List!Part parts)
Undocumented in source.

Members

Classes

Builder
class Builder
Undocumented in source.
Part
class Part
Undocumented in source.

Functions

boundary
string boundary()
Undocumented in source. Be warned that the author may not have intended to support it.
contentLength
long contentLength()
Undocumented in source. Be warned that the author may not have intended to support it.
contentType
MediaType contentType()

A combination of {@link #type()} and {@link #boundary()}.

isChunked
bool isChunked()
Undocumented in source. Be warned that the author may not have intended to support it.
isChunked
void isChunked(bool flag)
Undocumented in source. Be warned that the author may not have intended to support it.
part
Part part(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
parts
List!Part parts()
Undocumented in source. Be warned that the author may not have intended to support it.
size
int size()

The number of parts in this multipart body.

type
MediaType type()
Undocumented in source. Be warned that the author may not have intended to support it.
writeTo
void writeTo(HttpOutputStream sink)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

appendQuotedString
void appendQuotedString(StringBuilder target, string key)

Appends a quoted-string to a StringBuilder.

Variables

ALTERNATIVE
enum MediaType ALTERNATIVE;

The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, each of the body parts is an "alternative" version of the same information.

DIGEST
enum MediaType DIGEST;

This type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, in a digest, the default {@code Content-Type} value for a body part is changed from "text/plain" to "message/rfc822".

FORM
enum MediaType FORM;

The media-type multipart/form-data follows the rules of all multipart MIME data streams as outlined in RFC 2046. In forms, there are a series of fields to be supplied by the user who fills out the form. Each field has a name. Within a given form, the names are unique.

MIXED
enum MediaType MIXED;

The "mixed" subtype of "multipart" is intended for use when the body parts are independent and need to be bundled in a particular order. Any "multipart" subtypes that an implementation does not recognize must be treated as being of subtype "mixed".

PARALLEL
enum MediaType PARALLEL;

This type is syntactically identical to "multipart/mixed", but the semantics are different. In particular, in a parallel entity, the order of body parts is not significant.

Inherited Members

From HttpBody

contentType
string contentType()
Undocumented in source.
contentLength
long contentLength()

Returns the number of bytes that will be written to {@code sink} in a call to {@link #writeTo}, or -1 if that count is unknown.

append
void append(ubyte[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
append
void append(ByteBuffer buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
writeTo
void writeTo(HttpOutputStream sink)

Writes the content of this request to {@code sink}.

asString
string asString()
Undocumented in source. Be warned that the author may not have intended to support it.
getRaw
const(ubyte)[] getRaw()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
create
HttpBody create(T content)
Undocumented in source. Be warned that the author may not have intended to support it.
create
HttpBody create(string contentType, long contentLength)
Undocumented in source. Be warned that the author may not have intended to support it.
create
HttpBody create(string contentType, string content)

Returns a new request body that transmits {@code content}. If {@code contentType} is non-null and lacks a charset, this will use UTF-8.

create
HttpBody create(string contentType, ByteBuffer buffer)
Undocumented in source. Be warned that the author may not have intended to support it.
create
HttpBody create(string type, const(ubyte)[] content)

Returns a new request body that transmits {@code content}.

createFromFile
HttpBody createFromFile(string type, string fileName)

Returns a new request body that transmits the content of {@code file}.

Meta