0

I/flutter (7701): {name: mayank, password: mayank12} E/flutter (7701): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] 未处理异常:HandshakeException:客户端握手错误(OS错误:E/flutter(7701):CERTIFICATE_VERIFY_FAILED:无法获取本地颁发者证书(handshake.cc:354))E/flutter(7701):

import 'package:http/http.dart' as http;
import 'dart:convert';
import '../model/login_model.dart';

class APIService {
Future<LoginResponseModel> login(LoginRequestModel requestModel) async {

String url = "https://logistics.hub.com/mobile/req/staff-login/";
final response = await http.post(url, body: jsonEncode(requestModel.toJson()),headers: {"content- 
type":"application/json"});
 print(response.body);
 if (response.statusCode == 200 || response.statusCode == 400) {
  return LoginResponseModel.fromJson(
    json.decode(response.body),
  );
    } else {
   throw Exception('Failed to load data!');
  }
  }
  }
4

0 回答 0