This commit is contained in:
yutou 2023-09-13 15:30:46 +08:00
parent e595cff31d
commit c48db62d00

View File

@ -60,10 +60,8 @@ public class BaiduGPTManager {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("messages", messages); json.put("messages", messages);
System.out.println("json = " + json); System.out.println("json = " + json);
HashMap<String, String> header = new HashMap<>(); String post = HttpTools.post(url + "?access_token=" + getToken()
header.put("Content-Type", "application/json"); , json.toJSONString().getBytes(StandardCharsets.UTF_8));
String post = HttpTools.http_post(url + "?access_token=" + getToken()
, json.toJSONString().getBytes(StandardCharsets.UTF_8), 5, header);
System.out.println("post = " + post); System.out.println("post = " + post);
if (StringUtils.isEmpty(post)) { if (StringUtils.isEmpty(post)) {
clear(); clear();