SimpleRestApi class

A simple rest api where the response is generally obtained in plain string form.

Inheritance

Constructors

SimpleRestApi.new({String baseUrl = 'http://127.0.0.1:8080/service/', bool trustSelfSigned = false, Client? httpClient})
Creates a SimpleRestApi.

Properties

baseUrl String
The base url.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Sets the headers.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trustSelfSigned bool
Whether to trust self-signed certificates or not.
final

Methods

getResponseTypeFromCode(int? code) RestResponseType
Resolve to RestResponseType form status code.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request({required RestMethod method, required String path, Map<String, dynamic> requestBody = const {}}) Future<RestResponse<String>>
The Uri for the request is built inside ResApi, to give flexibility on how it is used. The path parameter corresponds to the Uri path, which doesn't hold the host, port and scheme.
override
requestBinary({required RestMethod method, required String path, Map<String, dynamic> requestBody = const {}}) Future<RestResponse<String>>
Request for binary data.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited