【发布时间】:2015-03-17 03:00:31
【问题描述】:
请问Codeigniter中是否有PHP函数可以模拟这段代码。
HttpClient httpClient = new HttpClient();
PostMethod postMethod = new PostMethod(requestURL);
NameValuePair[] datas = {new NameValuePair("studentnumber", studentnumber),
new NameValuePair("studentdata", encryptedData)};
postMethod.setRequestBody(datas);
int statusCode = httpClient.executeMethod(postMethod);
byte[] responseByte = postMethod.getResponseBody();
String responseBody = new String(responseByte, "UTF-8");
curl 似乎不起作用,而 $this->output->set_output 正确传递数据但未能捕获 requestUrl 的响应。
谢谢。
【问题讨论】:
标签: java php codeigniter http-post