HttpUtils class
Helper class for http requests
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
-
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
- client ↔ Client
-
getter/setter pair
Static Methods
-
addQueryParameterToUrl(
String url, Map< String, dynamic> ? queryParameters) → String -
Add the given
queryParameters
to the givenurl
. If the key for a parameter already exists then it is overwritten. -
deleteForFullResponse(
String url, {Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Response> -
Sends a HTTP DELETE request to the given
url
with the givenqueryParameters
andheaders
. Returns the fullResponse
object. -
deleteForJson(
String url, {Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Map< String, dynamic> > -
Sends a HTTP DELETE request to the given
url
with the givenqueryParameters
andheaders
. Returns the response as a map using json.decode. -
deleteForString(
String url, {Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<String> -
Sends a HTTP DELETE request to the given
url
with the givenqueryParameters
andheaders
. Returns the response as a string. -
getForFullResponse(
String url, {Map< String, dynamic> ? queryParameters, Map<String, String> ? headers}) → Future<Response> -
Sends a HTTP GET request to the given
url
with the givenqueryParameters
andheaders
. Returns the fullResponse
object. -
getForJson(
String url, {Map< String, dynamic> ? queryParameters, Map<String, String> ? headers}) → Future<Map< String, dynamic> > -
Sends a HTTP GET request to the given
url
with the givenqueryParameters
andheaders
. Returns the response as a map using json.decode. -
getForString(
String url, {Map< String, dynamic> ? queryParameters, Map<String, String> ? headers}) → Future<String> -
Sends a HTTP GET request to the given
url
with the givenqueryParameters
andheaders
. Returns the response as a string. -
getQueryParameterFromUrl(
String url) → Map< String, dynamic> ? -
Fetches the query parameter from the given
url
. Returns null if none exist. -
postForFullResponse(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Response> -
Sends a HTTP POST request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the fullResponse
object. -
postForJson(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Map< String, dynamic> > -
Sends a HTTP POST request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the response as a map using json.decode. -
postForString(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<String> -
Sends a HTTP POST request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the response as a string. -
putForFullResponse(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Response> -
Sends a HTTP PUT request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the fullResponse
object. -
putForJson(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<Map< String, dynamic> > -
Sends a HTTP PUT request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the response as a map using json.decode. -
putForString(
String url, {String? body, Map< String, String> ? queryParameters, Map<String, String> ? headers}) → Future<String> -
Sends a HTTP PUT request to the given
url
with the givenbody
,queryParameters
andheaders
. Returns the response as a string.