MCPcopy Create free account
hub / github.com/EhsanTang/ApiManager / put

Method put

api/src/main/java/cn/crap/utils/HttpPostGet.java:88–108  ·  view source on GitHub ↗
(String path, Map<String, String> params, Map<String, String> headers)

Source from the content-addressed store, hash-verified

86 }
87
88 public static String put(String path, Map<String, String> params, Map<String, String> headers) throws Exception {
89 HttpPut method = new HttpPut(path);
90 RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000)
91 .setConnectionRequestTimeout(5000).setStaleConnectionCheckEnabled(true).build();
92 // 请求的参数信息传递
93 List<NameValuePair> paires = new ArrayList<NameValuePair>();
94 if (params != null) {
95 Set<String> keys = params.keySet();
96 Iterator<String> iterator = keys.iterator();
97 while (iterator.hasNext()) {
98 String key = (String) iterator.next();
99 paires.add(new BasicNameValuePair(key, URLDecoder.decode(params.get(key), "UTF-8")));
100 }
101 }
102 if (paires.size() > 0) {
103 HttpEntity entity = new UrlEncodedFormEntity(paires, "utf-8");
104 method.setEntity(entity);
105 }
106 method.setConfig(requestConfig);
107 return postMethod(method, params, headers);
108 }
109
110 public static String post(String path, Map<String, String> params, Map<String, String> headers) throws Exception {
111 HttpPost method = new HttpPost(path);

Callers 15

debugMethod · 0.95
getErrMapMethod · 0.80
getRequestHeadersMethod · 0.80
getRequestParamsMethod · 0.80
getMapMethod · 0.80
getStrMapMethod · 0.80
mysqlToDictionaryMethod · 0.80
preLoginMethod · 0.80
staticizeErrorMethod · 0.80
interfaceListMethod · 0.80
staticizeModuleMethod · 0.80

Calls 3

postMethodMethod · 0.95
addMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected