应用加速器发布请求。在一个请求中多次发送一个变量。
你好!我想在一次后查询中发送变量几次(每次都有不同的值)。 在 HTML 形式中,它的工作原理和外观如下:
<form method="POST" action="http://localhost/index.php">
<input type="hidden" name="line_item" value="value1">
<input type="hidden" name="line_item" value="value2">
<input type="hidden" name="line_item" value="value3">
</form>
但 appcelerator 仅发送此代码中的最后一个值:
var httpClient = Titanium.Network.createHTTPClient();
var params = {
line_item:'value1',
line_item:'value2',
line_item:'value3',
};
httpClient.open('POST', 'http://localhost/index.php');
httpClient.send(params);
有人能帮忙吗?谢谢。
抱歉,我忘了提及我无法访问服务器,我需要在 appcelerator 中解决它。
Hallo! I want to send variable few times(each time with different value) in one post query.
In HTML form it works and looks like:
<form method="POST" action="http://localhost/index.php">
<input type="hidden" name="line_item" value="value1">
<input type="hidden" name="line_item" value="value2">
<input type="hidden" name="line_item" value="value3">
</form>
But appcelerator sends only the last value in this code:
var httpClient = Titanium.Network.createHTTPClient();
var params = {
line_item:'value1',
line_item:'value2',
line_item:'value3',
};
httpClient.open('POST', 'http://localhost/index.php');
httpClient.send(params);
Can anyone help? Thanks.
Sorry, I forgot to mention that I don't have access to server and I need it solved in appcelerator.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你使用PHP作为服务器平台,你可以将POST变量加入到数组中
,然后像php中的数组一样处理它:
if you use PHP as server platform, you can join POST-variables to array
and then process it like array in php:
解决了...
Solved...