简体   繁体   中英

Connection Error , there was a networking error in the connection to “url”

OutPut Image 控制台输出

im trying to make an addAction, the method is working just fine on symfony web app and i get the data inserted, but im getting this error on my project when running it. and im wondering what can i do to recognize the error

Connection Error, there was a networking error in the connection to http://localhost/KiddoEsprit/web/app_dev.php/ajoutermobile/aaaaaaaaaa/bbbbbbbbbb/

public void ajouterReclamation(Reclamation r){
        ConnectionRequest con = new ConnectionRequest();
        String Url = "http://localhost/KiddoEsprit/web/app_dev.php/ajoutermobile/" +r.getTitre()+ "/" + r.getContenu()  ;
    con.setUrl(Url);

    con.addResponseListener((l) -> {
        String str = new String(con.getResponseData());
        System.out.println(str);

    });
    NetworkManager.getInstance().addToQueueAndWait(con);

    }

the error is fixed when i started sending the object in a request

String Url = "http://localhost/KiddoEsprit/web/app_dev.php/ajoutermobile?titre=" + r.getTitre()+ "&contenu=" + r.getContenu()  ;

and changed a few code lines on my symfony app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM