package;
import org.apache.http.*;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
*
* 简单的发起post或者get请求;默认编码方式为utf-8
* <p>
* SimpleHttpRequest simpleHttpRequest = new SimpleHttpRequest();<br/>
* String reuslt = simpleHttpRequest.addParams("wd","百度i 下").get("http://www.baidu.com");<br/>
* System.out.println(reuslt);
* <p/>
* @author tao
*/
public class SimpleHttpRequ
httpClient简单例子
最新推荐文章于 2023-03-03 16:37:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)