| | |
| | | |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | |
| | | JsonObject jo=new JsonObject(); |
| | | CloseableHttpClient httpclient = HttpClients.createDefault(); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | String re=null; |
| | | List<NameValuePair> fps=new ArrayList<NameValuePair>(); |
| | | UrlEncodedFormEntity entity=null; |
| | |
| | | // s.setContentEncoding("UTF-8"); |
| | | // hp.setEntity(s); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | StringEntity se=new StringEntity(jsonStr, Charset.forName("utf-8")); |
| | | se.setContentType("application/json"); |
| | | hp.setEntity(se); |
| | |
| | | { |
| | | CloseableHttpClient httpclient = HttpClients.createDefault(); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | String re=null; |
| | | List<NameValuePair> fps=new ArrayList<NameValuePair>(); |
| | | UrlEncodedFormEntity entity=null; |
| | |
| | | CloseableHttpClient httpclient=nssl(); |
| | | // CloseableHttpClient httpclient = HttpClients.createDefault(); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | String re=null; |
| | | List<NameValuePair> fps=new ArrayList<NameValuePair>(); |
| | | UrlEncodedFormEntity entity=null; |
| | |
| | | { |
| | | CloseableHttpClient httpclient=nssl(); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | MultipartEntityBuilder me=MultipartEntityBuilder.create(); |
| | | me.addBinaryBody(upfilename, file); |
| | | if(params!=null) |
| | |
| | | { |
| | | CloseableHttpClient httpclient=nssl(); |
| | | HttpPost hp=new HttpPost(url); |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | hp.setConfig(config); |
| | | StringEntity se=new StringEntity(body, Charset.forName("utf-8")); |
| | | hp.setEntity(se); |
| | | String re=null; |