1.后台写入发送请求的代码
- (1)所需jar包 
- (2)代码1 
 2
 3
 4
 5HttpClient client=new DefaultHttpClient();//初始化httpclient 
 String url="http://192.168.122.139";
 HttpPost postMethod=new HttpPost(url);//post方法请求url
 //HttpGet getMethod=new HttpGet(url);//get方式
 client.execute(postMethod);
2.利用ajax进行请求发送
| 1 | /*get方式*/ | 
3.普通js实现
| 1 | function test(){ | 
注:
- 如有不正确还请见谅。
- 另外,想了解更多,请访问我的Github:https://github.com/Zxnaruto
 
		 
                      