【发布时间】:2013-09-23 11:03:43
【问题描述】:
我连接后的方法如下:
try {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod(VERIFY_PAYMENT_ACTIONURL);
// key is the parameter
// MERCHANT_KEY is the value
method.addParameter("key", MERCHANT_KEY.trim());
method.addParameter("command", VERIFY_PAYMENT_COMMAND.trim());
method.addParameter("hash", hash);
method.addParameter("var1", transactionID);
method.addParameter("salt", ALGORIHTM_SHA512_SALT_KEY.trim());
int statusCode = client.executeMethod(method);
} catch (Exception e) {
e.printStackTrace();
}
这工作正常,我得到200 作为状态代码,因为该方法是成功的。我希望得到整个响应,因为我必须根据返回的响应执行更多功能。
来自服务器的响应是如下数组:
array('status' => '1',
'msg' => 'Transaction Fetched Successfully',
'transaction_details' =>
array(
unknown)
)
);
我必须得到 from the response like msg etc 的值。
所以我的问题是如何检索从post call 返回的响应对象
请有人帮我解决这个问题..
【问题讨论】:
标签: java http-post httpclient httpresponse