在網上找到一個 JAVA實現Python requests模塊(JAVA實現Http請求)
try {
logger1.info("===============>>>>>" + Path + "------------>>" + headers);
data= Requests.post(Path)
.headers(headers )
.requestCharset(cs)
.send()
.readToText();
}catch (Exception e){
e.printStackTrace();
data = "error";
}
其中Charset cs = Charset.forName("utf-8");
這段代碼在window上也就是本地運行是沒有問題的,但是部署到服務器上就會報錯,日志打印看的傳參都沒有問題,這是什么原因?
添加回答
舉報
0/150
提交
取消