HttpBody class sealed

Constructors

HttpBody.bytes(Uint8List bytes)
A body of raw bytes.
const
factory
HttpBody.form(Map<String, String> form)
A www-form-urlencoded body. The Content-Type header will be set to application/x-www-form-urlencoded if not provided.
const
factory
HttpBody.json(Object? json)
A JSON body. The Content-Type header will be set to application/json if not provided.
const
factory
HttpBody.multipart(Map<String, MultipartItem> formData)
Multi-part form data. The Content-Type header will be overridden to multipart/form-data with a random boundary.
factory
HttpBody.stream(Stream<List<int>> stream, {int? length})
A body of a raw bytes stream. This is useful to avoid loading the entire body into memory. The Content-Length header will be set if length is provided.
const
factory
HttpBody.text(String text)
A plain text body.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited