[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$frBg8iyCtytRhz2t4iQQ96Lr2lMlx-90MvyzjW6ORrUU":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":10,"question":17,"related":18,"source":22,"type":23},[],"2026-04-28 15:29:39",353683997,[8,9],"正确","错误",{"count":11,"courseId":12,"courseImg":13,"courseName":14,"workId":15,"workName":16},10,"53e1d2ef4961cca8eea3e23969ad2cb9","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F03a579384a6dc297c89809b582fcc767.png","默认课程","work_52371790","GET和POST请求","在 Gin 中,r.GET(&quot;\u002Fuser&quot;, UserHandler) 只能处理 GET 类型的请求",[19,24,29,34,39,44,49,54,59,64],{"answer":20,"createTime":5,"id":6,"options":21,"question":17,"source":22,"type":23},[],[8,9],"v1",3,{"answer":25,"createTime":5,"id":26,"options":27,"question":28,"source":22,"type":23},[],353683998,[8,9],"表单提交一般使用 POST 请求,不建议用 GET 提交敏感数据",{"answer":30,"createTime":5,"id":31,"options":32,"question":33,"source":22,"type":23},[],353683999,[8,9],"r.POST(&quot;\u002Flogin&quot;) 可以通过浏览器地址栏直接访问并正常执行",{"answer":35,"createTime":5,"id":36,"options":37,"question":38,"source":22,"type":23},[],353684000,[8,9],"GET 请求可以通过 c.Query(&quot;key&quot;) 获取 URL 问号后面的参数",{"answer":40,"createTime":5,"id":41,"options":42,"question":43,"source":22,"type":23},[],353684001,[8,9],"POST 表单数据只能用 c.Param() 获取,不能用 c.PostForm()",{"answer":45,"createTime":5,"id":46,"options":47,"question":48,"source":22,"type":23},[],353684002,[8,9],"在 Gin 里,GET 和 POST 可以绑定同一个 URL 路径",{"answer":50,"createTime":5,"id":51,"options":52,"question":53,"source":22,"type":23},[],353684003,[8,9],"c.Param(&quot;id&quot;) 用于获取 \u002Fuser\u002F:id 这种路径里的参数,GET\u002FPOST 都能用",{"answer":55,"createTime":5,"id":56,"options":57,"question":58,"source":22,"type":23},[],353684004,[8,9],"浏览器刷新页面、地址栏访问、a 标签默认跳转都是 GET 请求",{"answer":60,"createTime":5,"id":61,"options":62,"question":63,"source":22,"type":23},[],353684005,[8,9],"form 表单如果不写 method,默认就是 POST 请求",{"answer":65,"createTime":5,"id":66,"options":67,"question":68,"source":22,"type":23},[],353684006,[8,9],"在 Gin 中,POST 请求无法使用模板渲染 c.HTML()"]