• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

234
Vistas
error 111 Flutter VS Laravel 8

Actualmente estoy trabajando en un proyecto en el que me quedé atascado al conectar Laravel 8 con Flutter. Cuando ejecuto la API normal dentro de Postman, todo funciona perfectamente una vez que lo pruebo dentro de Flutter, obtuve el siguiente error.

 Unhandled Exception: SocketException: OS Error: Connection refused, errno = 111, address = [IP Address Server], port = 43798

No entiendo, el código está bien. Cuando llamo a la API dentro de otro proyecto de laravel, funciona perfectamente, solo cuando lo llamo en Flutter, aparece este error.

Qué puede ser. No lo ejecutamos localmente, es servidor -> flutter

Código de aleteo:

 Future<User> getUser(url) async { print("here"); var params = { "id": "01142", }; Uri uri = Uri.parse(url); uri.replace(queryParameters: params); final response = await http.get( uri, headers: <String, String>{ 'Content-Type': 'application/json', 'Accept': "*/*", 'connection': 'keep-alive', 'Accept-Encoding': 'gzip, deflate, br', 'host': 'ipv4', }, ); if (response.statusCode == 200) { // If the server did return a 200 OK response, // then parse the JSON. user = User.fromJson(jsonDecode(response.body)); print("NEW USER"); print(user); return user; } else { // If the server did not return a 200 OK response, // then throw an exception. throw Exception('Failed to load user'); } }
almost 3 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda