HttpProvider class Null safety
Abstracts the http requests into a single class, that way the repositories are independent of the requests package that is being used.
Makes use of the package http.
Receives an http.Client where the requests will be send.
Constructors
- HttpProvider(Client client)
-
const
Properties
- client → Client
-
final
- hashCode → int
-
The hash code for this object.
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
get(
Uri url, {Map< String, String> ? headers}) → Future<Response> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
post(
Uri url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> - Sends an HTTP POST request with the given headers and body to the given URL.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited