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 themimeType
if that fails we revert to text/plain. throws FetchException if the file atpathToData
does not exist or it is not a file. -
FetchData.fromStream(Stream<
List< stream, {String mimeType = 'application/octet-stream'})int> > -
Use the
stream
as the source of the FetchData to send. ThemimeType
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
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