ApiMethods class
A utility class for making HTTP GET and POST requests.
The ApiMethods class provides methods to perform HTTP GET and POST requests, with and without authentication tokens. It also includes a static property for setting an API key.
Constructors
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
-
getMethod(
{String? url, Map< String, String> ? headers}) → Future<(int, Map< String, dynamic> )> -
Sends an HTTP GET request to the specified
url
with optionalheaders
. -
getMethodWithToken(
{String? url, dynamic token}) → Future< (int, Map< String, dynamic> )> -
Sends an HTTP GET request to the specified
url
with an authenticationtoken
and optional API key. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postMethod(
{String? url, Map< String, String> ? headers, dynamic body}) → Future<(int, Map< String, dynamic> )> -
Sends an HTTP POST request to the specified
url
with optionalheaders
and requestbody
. -
postMethodWithToken(
{String? url, dynamic token, dynamic body}) → Future< (int, Map< String, dynamic> )> -
Sends an HTTP POST request to the specified
url
with an authenticationtoken
, requestbody
, and optional API key. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited