FileNotFoundException at URL

前端 未结 1 1602
不思量自难忘°
不思量自难忘° 2020-12-22 06:38

I am trying to get the request from the php url.File not found exception occurred at runtime.I mentioned the error line in the below code.Stacktrace seems to be doesn\'t get

相关标签:
1条回答
  • 2020-12-22 07:15

    try replace this lines

    String temp=sName.replace(" ","%20");
    URL js = new URL("http://192.11.my api.php"+temp);
    

    with

    String temp=URLEncoder.encode("http://192.11.my api.php/"+sName, "UTF-8");
    URL js = new URL(temp);
    
    0 讨论(0)
提交回复
热议问题