FliqRequest class
Represents an HTTP request made with the Fliq library.
Example:
final client = Fliq();
final response = await client.get('https://example.com').go();
print('Status Code: ${response.statusCode}');
client.close();
- Available extensions
Constructors
- FliqRequest(String method, String url, HttpClient client)
- Constructs a new instance of FliqRequest.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- request → HttpClientRequest
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
form(
{Map< String, String> fields = const {}, List<FormFile> files = const []}) → FliqRequest -
Available on FliqRequest, provided by the FormExtension extension
Appends form data and/or files to the request as part of a multipart form. -
go(
) → Future< HttpClientResponse> - Executes the HTTP request and returns a Future with the response.
-
header(
String key, String value) → FliqRequest - Adds a header to the request.
-
json(
Map< String, dynamic> data) → FliqRequest -
Sets the request body to the JSON-encoded
data. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
path(
String pathSegment) → FliqRequest - Appends a path segment to the request's URL.
-
query(
String key, String value) → FliqRequest - Appends a query parameter to the request's URL.
-
readOne<
T> (T fromMap(Map< String, dynamic> )) → Future<T> -
Reads the response body as JSON and applies the
fromMapfunction to create an object. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited