今天在工作中,使用了http发送post和get请求,遇到了如下异常,记录于此
java.net.MalformedURLException: no protocol: www.baidu.com at java.net.URL.<init>(URL.java:567) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at com.syxp.pdma.fx.CaptureService.main(CaptureService.java:351)
错误原因就是这是http请求,需要在请求地址上加入 http://协议