Added RegisterPost in API
This commit is contained in:
parent
47dbb72567
commit
91442312b7
1 changed files with 20 additions and 1 deletions
|
@ -11,4 +11,23 @@ Future<dynamic> getProduct(id) async {
|
|||
var req = await Dio().get(host + '/getproduct', queryParameters: {'id': id});
|
||||
var res = req.data;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> RegisterPost({email, password, first_name, last_name}) async {
|
||||
Response req = await Dio().post(
|
||||
(host + '/register'),
|
||||
data: {
|
||||
'email': email,
|
||||
'password': password,
|
||||
'first_name': first_name,
|
||||
'last_name': last_name
|
||||
},
|
||||
options: Options(
|
||||
contentType: Headers.formUrlEncodedContentType,
|
||||
validateStatus: (status) {
|
||||
return status! < 500;
|
||||
},
|
||||
),
|
||||
);
|
||||
return req.statusCode;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue