pf_dart_http

Last updated:

0 purchases

pf_dart_http Image
pf_dart_http Images
Add to Cart

Description:

pf dart http

Problem Fighter Dart HTTP Request Library #
Simple Print Method #
void printResponse(PFHttpResponse response){
print('\n\n');
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');
}
copied to clipboard
POST Request #
var baseURL = "https://flask-hmtmcse.herokuapp.com/";
var data = {
"description": "postJsonRequest",
"name": "postJsonRequest",
"target": "postJsonRequest",
"targetType": "postJsonRequest",
"title": "postJsonRequest",
"type": "TextOnly"
};

var response = await PFDartHTTP.instance().POSTRequest(baseURL + "api/v1/card/form-data", data: data);
printResponse(response);
copied to clipboard
JSON POST Request #
var baseURL = "https://flask-hmtmcse.herokuapp.com/";
var jsonCreate = {
'data': {
"description": "postJsonRequest",
"name": "postJsonRequest",
"target": "postJsonRequest",
"targetType": "postJsonRequest",
"title": "postJsonRequest",
"type": "TextOnly"
}
};

var response = await PFDartHTTP.instance().jsonPOSTRequest(baseURL + "api/v1/card/create", data: jsonCreate);
printResponse(response);
copied to clipboard
Simple Get Request #
var baseURL = "https://flask-hmtmcse.herokuapp.com/";
var response = await PFDartHTTP.instance().GETRequest(baseURL + "api/v1/card/list");
printResponse(response);
copied to clipboard
POST upload file Request #
var baseURL = "https://flask-hmtmcse.herokuapp.com/";
var file = File("C:\\Users\\hmtmc\\Desktop\\gm\\consumer\\8.order-list.jpeg");
var uploadFileMap = {
"name": file
};
var response = await PFDartHTTP.instance().uploadRequest(baseURL + "api/v1/card/upload-file", uploadFileMap);
printResponse(response);
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.