nitrogen / simple_bridge

A simple, standardized interface library to Erlang HTTP Servers.
MIT License
112 stars 76 forks source link

Req:deep_post_params() raise Error. #47

Open dcy opened 9 years ago

dcy commented 9 years ago
Module: xyadmin_email_controller, Line: 22, 
My print's "Req : post_params ( )" is [{"title","dsfasdfasdf"},
                                       {"serverlists[]","2"},
                                       {"users",[]},
                                       {"content","asdfasdfasdf"},
                                       {"attachments[0][item_type]","1"},
                                       {"attachments[0][item_id]","1"},
                                       {"attachments[0][item_name]","1"},
                                       {"attachments[0][item_amount]","1"},
                                       {"attachments[1][item_type]","2"},
                                       {"attachments[1][item_id]","1"},
                                       {"attachments[1][item_name]","1"},
                                       {"attachments[1][item_amount]","1"}]

How can i get the "attachments"? I tried Req:param_group("attachments[]"), Req:post_param("attachments"), Req:post_param_group("attachments[]")

Req:deep_post_params() and Req:deep_post_param("attachments") will raise Error: [error] Error in controller error:{case_clause,nomatch} Stacktrace: [{simple_bridge_request_wrapper,parse_deep_post_params,3,[{file,"src/simple_bridge_request_wrapper.erl"},{line,148}]},{xyadmin_email_controller,send,4,[{file,"/home/dcy/xyadmin/src/controller/xyadmin_email_controller.erl"},{line,30}]},{boss_web_controller,call_controller_action,3,[{file,"src/boss/boss_web_controller.erl"},{line,316}]},{boss_web_controller,apply_action,4,[{file,"src/boss/boss_web_controller.erl"},{line,308}]},{boss_web_controller,execute_action_inner,9,[{file,"src/boss/boss_web_controller.erl"},{line,287}]},{boss_web_controller_handle_request,process_dynamic_request,5,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,254}]},{boss_web_controller_handle_request,process_request,5,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,240}]},{boss_web_controller_handle_request,set_timer,8,[{file,"src/boss/boss_web_controller_handle_request.erl"},{line,160}]}]

It also at https://github.com/ChicagoBoss/ChicagoBoss/issues/576

choptastic commented 9 years ago

Thanks!