Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
err 111 Flutter VS Laravel 8

I'm currently working on a project where i got stuck on connecting Laravel 8 with Flutter. When I run the API normal inside Postman, everything works perfectly once I try it inside Flutter i got the follow error.

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

I don't understand, the code is fine. When I Call the API inside another laravel project then it works perfectly, only when I call it in Flutter i got this error.

What can it be. We don't run it locally it is server -> flutter

Flutter code:

    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');
    }
  }
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda