otp_provider.dart 543 B

123456789101112131415161718192021
  1. import 'package:http/http.dart' as http;
  2. class OTPProvider{
  3. final String _url = "smart.solerpalau.mx";
  4. Future<void> fetchOTP(String token, String dinum, String otp, String date, String until, String year) async{
  5. final url = Uri.https(_url, 'PR/api/v1/quiosco/sendOTP');
  6. await http.post(url,
  7. headers: {
  8. 'Authorization' : 'Bearer $token'
  9. },
  10. body: {
  11. 'DINUM' : dinum,
  12. 'OTP' : otp,
  13. 'DATE' : date,
  14. 'UNTIL' : until,
  15. 'YEAR' : year
  16. }
  17. );
  18. }
  19. }