ubnt解决方案
查看: 955|回复: 0

openwrt 里LUA程序怎么获取POST数据?

[复制链接]

0

回帖

30

积分

6 小时

在线时间

新兵上阵

注册时间
2014-11-5
金币
27 个
威望
0 个
荣誉
0 个
累计签到:1 天
连续签到:0 天
[LV.20]漫游旅程
发表于 2015-6-24 23:30 |显示全部楼层
5金币
openwrt 里LUA程序怎么获取POST数据?
系统:openwrt
lua 是否直接调用luci.http.formvalue()就可以直接获得post的值?
该怎么测试呢?
我的尝试:在/web/luatest/ 建立test.lua 内容为:
#!/usr/bin/lua
local h = require "luci.http"
local info =assert( h.formvalue("a"),test)
http.write("Content-type: text/html\r\n\r\n")
http.write("a is:"..info)

然后再浏览器输入http://192.168.10.1:88/luatest/test.lua?a=1
却报错bad gateway
谢谢!感激不尽

您需要登录后才可以回帖 登录 | 注册 微信登录

本版积分规则

站点统计 | Archiver | 手机版 | 无线门户 ( 粤ICP备11076993号|粤公网安备44010602008359号 ) |网站地图

GMT+8, 2024-4-30 13:03

返回顶部 返回列表