关于beego框架 controller GetString获取参数失败


问题描述:在注册页面逻辑实现是,时时无法获取页面的填写的注册信息,查找许多资料终于解决;

 <form  class="login_form" name = "login" method="post" action="/register" content="application">
        <h1 class="login_title">用户注册</h1>
        <input type="text" placeholder="用户名" class="input_txt" name="userName">
        <input type="password" placeholder="密码" class="input_txt" name = "password">
        <input type="submit" value="注 册" class="input_sub">
    </form>

  因为客户端发送请求的content-type为 text/plain,最后是把发送请求的content-type 改成了 application/x-www-form-urlencoded最终问题迎刃而解


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM