1
This commit is contained in:
@@ -25,7 +25,7 @@ import org.springframework.http.MediaType;
|
||||
|
||||
/**
|
||||
* 通用http发送方法
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class HttpUtils
|
||||
@@ -129,10 +129,21 @@ public class HttpUtils
|
||||
{
|
||||
return sendPost(url, param, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
||||
}
|
||||
/**
|
||||
* 向指定 URL 发送POST方法的请求,请求体为JSON格式
|
||||
*
|
||||
* @param url 发送请求的 URL
|
||||
* @param json JSON格式的请求体
|
||||
* @return 所代表远程资源的响应结果
|
||||
*/
|
||||
public static String sendJsonPost(String url, String json)
|
||||
{
|
||||
return sendPost(url, json, MediaType.APPLICATION_JSON_VALUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定 URL 发送POST方法的请求
|
||||
*
|
||||
*
|
||||
* @param url 发送请求的 URL
|
||||
* @param param 请求参数
|
||||
* @param contentType 内容类型
|
||||
@@ -290,4 +301,4 @@ public class HttpUtils
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user