關於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