HttpHelper class
General functions for sending http requests (post, get, multipart, ...)
Constructors
- HttpHelper()
-
factory
- HttpHelper.internal()
- A protected constructor to allow subclasses to create themselves.
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
-
doGetRequest(
Uri uri, {User? user, QueryType? queryType}) → Future< Response> - Send a http get request to the specified uri. The data of the request (if any) has to be provided as parameter within the uri. The result of the request will be returned as string. By default the query will hit the PROD DB
-
doMultipartRequest(
Uri uri, Map< String, String> body, {Map<String, Uri> ? files, User? user, QueryType? queryType}) → Future<Status> - Send a multipart post request to the specified uri. The data / body of the request has to be provided as map. (key, value) The files to send have to be provided as map containing the source file uri. As result a json object of the "type" Status is expected.
-
doPatchRequest(
Uri uri, Map< String, dynamic> body, User? user, {QueryType? queryType}) → Future<Response> - Send a http PATCH request to the specified uri.
-
doPostRequest(
Uri uri, Map< String, String> body, User? user, {QueryType? queryType, required bool addCredentialsToBody, bool addCredentialsToHeader = false}) → Future<Response> - Send a http post request to the specified uri. The data / body of the request has to be provided as map. (key, value) The result of the request will be returned as string.
-
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
Static Properties
- instance ↔ HttpHelper
-
Gets the instance
getter/setter pair
Static Methods
-
addUserAgentParameters(
Map< String, dynamic> ? map) → Map<String, dynamic> ? - Adds user agent data to parameters, for statistics purpose
Constants
- FROM → const String
- USER_AGENT → const String
- userInfoForTest → const String