FetchData class

Used with the fetch function to send data for the likes of a POST command.

Constructors

FetchData.fromBytes(List<int> bytes, {String mimeType = 'application/octet-stream'})
Use the passed bytes as the source of the FetchData.
FetchData.fromFile(String pathToData, {String? mimeType})
Read the FetchData from a file where pathToData is the path to the file containing the data to send. pathToData may be relative or absolute. If the mimeType isn't passed then we use the file extension to determine the mimeType if that fails we revert to text/plain. throws FetchException if the file at pathToData does not exist or it is not a file.
FetchData.fromStream(Stream<List<int>> stream, {String mimeType = 'application/octet-stream'})
Use the stream as the source of the FetchData to send. The mimeType defaults to application/octet-stream
FetchData.fromString(String string, {String mimeType = 'text/plain'})
Use a String as the source of the FetchData The mimeType defaults to text/plain.

Properties

hashCode int
The hash code for this object.
no setterinherited
mimeType String
Returns the mime type of the data.
no setter
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