당신의 HTTPRequest 확인하고 다른 않는 소켓을 통해 몸, 샘플 자바 코드와 DELETE 요청을 할 수 있습니다 본문과 함께 DELETE 요청 :
public static HTTPResponse execute(HTTPRequest request) throws ExecutionException, InterruptedException {
if (request == null) {
throw new IllegalArgumentException("Missing request!");
}
if (request.getMethod() == HTTPMethod.DELETE && request.getPayload() != null && request.getPayload().length > 0) {
URL obj = request.getURL();
SSLSocketFactory socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
try {
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
HttpsURLConnection.setDefaultSSLSocketFactory(socketFactory);
con.setRequestMethod("DELETE");
for (HTTPHeader httpHeader : request.getHeaders()) {
con.setRequestProperty(httpHeader.getName(), httpHeader.getValue());
}
con.setDoOutput(true);
con.setDoInput(true);
OutputStream out = con.getOutputStream();
out.write(request.getPayload());
out.flush();
out.close();
List<HTTPHeader> responseHeaders = new ArrayList<>();
for (Map.Entry<String, List<String>> stringListEntry : con.getHeaderFields().entrySet()) {
for (String value : stringListEntry.getValue()) {
responseHeaders.add(new HTTPHeader(stringListEntry.getKey(), value));
}
}
return new HTTPResponse(con.getResponseCode(), StreamUtils.getBytes(con.getInputStream()), con.getURL(), responseHeaders);
} catch (IOException e) {
log.severe(e.getMessage());
}
} else {
Future<HTTPResponse> future = URLFetchServiceFactory.getURLFetchService().fetchAsync(request);
return future.get();
}
return null;
}
동의, 버그 같습니다. –
나는이 문제에 별표를 표시하고 다음과 같이 논평했다. http://code.google.com/p/googleappengine/issues/detail?id=601&q=post%20delete&colspec=ID%20Type%20Status%20Priority%20Stars% 20Owner % 20Summary % 20Log % 20Component – elkelk
elkelk, 그 버그는 여기의 질문과 관련이 없습니다. –