1
java에서 Apache HTTP 클라이언트를 사용하여 PUT 요청을 만들고 있지만 오류가 발생합니다. 여기에 내 기능입니다 :HTTP 클라이언트 PUT 요청 오류
public static void putRequest(String url, JSONObject setObject)
{
try
{
PutMethod put = new PutMethod(url);
HttpMethodParams httpParams = new HttpMethodParams();
if(setObject != null)
httpParams.setParameter("JSONString", setObject.toJSONString());
put.setParams(httpParams);
try
{
int result = httpclient.executeMethod(put);
System.out.println("HTTP response code : " + result);
String getResp = put.getResponseBodyAsString();
System.out.println("postresp ==> " + getResp);
put.releaseConnection();
}
catch(Exception e)
{
e.printStackTrace();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
는 내가 무엇입니까 응답은 다음과 같습니다 어디에서 잘못하고있는 중이 야
{"code":6,"message":"Internal Error"}
?
귀하의 오류는 엔드 포인트 URL에서 비롯됩니다. 아마도 잘못된 데이터를 제공하고 있으며 백엔드에서 오류를 발생시킵니다. –