首页 > 代码库 > how to write bash shell CGI under uHTTPd
how to write bash shell CGI under uHTTPd
how to write bash shell CGI under uHTTPd
cgi
- Target
- Reference
- WWW ROOT Dir on OpenWRT
- Browser Client Access
Target
Want to provide the smaple RESTful server under uHTTPd on OpenWRT, I select the bash script for a demo
Reference
Bash CGI
Web CGI with Bash Script
PostMan Tester
WWW ROOT Dir on OpenWRT
/www/cgi/test.cgi
- #!/bin/sh
- POST_STRING=$(cat)
- echo "Content-type: application/json"
- echo ""
- echo "$POST_STRING"
uHTTPd passes ‘GET’ paramter to bash by ‘$QUERY_STRING’
uHTTPd passes ‘POST’ conent to bash by STDIN, so bash use ‘POST_STRING=$(cat)’ to get them
Browser Client Access
http://192.168.254.219/cgi-bin/test.cgi
nicephil@gmail.com 2017-4-21
how to write bash shell CGI under uHTTPd
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。