0

我需要将 XML 数据发送到 URL。XML 数据包含在字符串缓冲区中。我需要发布它并获取响应代码。

谁能告诉我该怎么做?

我有一段代码,但 Eclipse 说它已弃用

PostMethod postMethod = new PostMethod(URL);
InputStream stream = new StringBufferInputStream(command);
                postMethod.setRequestBody(stream);
4

1 回答 1

1

Javadoc说要改用setRequestEntity(RequestEntity)

于 2012-04-06T19:54:02.140 回答