HttpContent class base

HTTP content providing body and stream access for a HTTP response data.

Inheritance

Constructors

HttpContent(Uri reference, BaseResponse response, {Encoding fallback = latin1})
Create a file content of reference and response.

Properties

bytes Future<Uint8List>
Reads content body as bytes and returns a future of Uint8List.
no setteroverride
contentLength int?
An optional content length as number of bytes.
no setteroverride
encoding Encoding
The expected charset encoding.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
mediaType → MediaType
The expected media type.
no setteroverride
reference Uri
The URI reference to a resource this anchor is referring.
final
response → BaseResponse
The HTTP response as an origin for this content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text Future<String>
Reads content body as text and returns a future of String.
no setteroverride

Methods

byteData([int start = 0, int? end]) Future<ByteData>
Reads content body as bytes and returns a future of ByteData.
override
byteStream() Stream<List<int>>
Returns content body as a single-subscription byte stream.
override
decodeJson({Object? reviver(Object? key, Object? value)?}) Future
Reads and decodes content body as a JSON object, returned in a future.
override
hasType(String primaryType, String subType0, [String? orSubType1, String? orSubType2, String? orSubType3, String? orSubType4]) bool
Checks if "content-type" equals with primaryType and one of sub types.
inherited
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