httpRequest method
void
httpRequest(])
override
Processes the HTTP request, returning the server's response via the completion callback.
Implementation
@override
void httpRequest(String method, String? url,
[String? data, Map<String, String>? headers]) {
// Query CMIS over HTTP
final uri = Uri.parse(url!);
if (method == 'GET') {
_client
.get(uri, headers: headers!)
.then(onSuccess, onError: onError)
.whenComplete(completion);
} else if (method == 'PUT') {
_client
.put(uri, headers: headers!, body: data)
.then(onSuccess, onError: onError)
.whenComplete(completion);
} else if (method == 'POST') {
_client
.post(uri, headers: headers!, body: data)
.then(onSuccess, onError: onError)
.whenComplete(completion);
} else if (method == 'HEAD') {
_client
.head(uri, headers: headers!)
.then(onSuccess, onError: onError)
.whenComplete(completion);
} else if (method == 'DELETE') {
_client
.delete(uri, headers: headers!)
.then(onSuccess, onError: onError)
.whenComplete(completion);
}
}