nginx模塊開發獲取post參數


> 您好!
>     我想請問下nginx模塊里面怎么獲取post參數,能有具體的代碼更好!謝謝
>

對於 "application/x-www-form-urlencoded" 格式的 POST 參數獲取,可以參考 ngx_lua 模塊的
ngx.req.get_post_args() 函數以及 ngx_form_input 模塊的實現:

    http://wiki.nginx.org/HttpLuaModule#ngx.req.get_post_args

    https://github.com/calio/form-input-nginx-module

而對於 "multipart/form-data" 格式的 POST 參數獲取,可以參考 ngx_upload 模塊以及 lua-resty-upload 庫:

http://www.grid.net.ru/nginx/upload.en.html

https://github.com/agentzh/lua-resty-upload

Best regards,
-agentzh


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM