当前位置:网站首页>Small example of gin - get request 2-handle handles post requests
Small example of gin - get request 2-handle handles post requests
2022-04-23 01:15:00 【Kuafu pursues dreams@】
1- The code running on the server is as follows :
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
func main() {
engine := gin.Default()
engine.Handle("POST", "/login", func(context *gin.Context) {
fmt.Println(context.FullPath())
//userName
username := context.PostForm("username")
fmt.Println(username)
//passWord
password := context.PostForm("pwd")
fmt.Println(password)
context.Writer.Write([]byte("User login"))
})
engine.Run(":9999")
}
2- How the client accesses :
postman Visit : choice post The way


posaman The second method of selecting parameters :params-- Fill in key

版权声明
本文为[Kuafu pursues dreams@]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230113266352.html
边栏推荐
- [JS] realize the export of PDF from the specified area of the web page
- Research and application of Acrel-5000 building energy consumption monitoring system in Xixian Airport Garden Project
- From construction to governance, the industry's first white paper on microservice governance technology was officially released (including a free download link)
- Is it difficult for girls to learn software testing?
- API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
- Tdengine deployment cluster installation
- 你真的会用K折交叉吗? 对于K折交叉的思考
- 12 years of testing predecessors give you some suggestions for learning software testing
- "Open source summer" activity is hot. In the registration, rich bonuses are waiting for you to get!
- Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
猜你喜欢

换个姿势看 hooks,灵感来源组合和 HOC 模式下逻辑视图分离新创意

Cai Guoqiang's fireworks NFT debut is as wonderful as fireworks during the day

engine.POST()处理POST请求

Research and application of Acrel-5000 building energy consumption monitoring system in Xixian Airport Garden Project

IMX6ULL裸机开发之配置eLCDIF点亮RGB液晶屏分析及配置过程

API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)

From construction to governance, the industry's first white paper on microservice governance technology was officially released (including a free download link)

Alibaba cloud container & Service Grid product technology trends (202203)
Elk setup (IV): monitor MySQL slow query and error log

【蓝桥杯国赛真题18】Scratch加法选择题 青少年组 scratch蓝桥杯国赛真题和答案讲解
随机推荐
12 years of testing predecessors give you some suggestions for learning software testing
Go 语言入门很简单:sort 中的sortInts 方法
Workplace PUA, five sins of managers
德勤2022技术趋势:IT自我颠覆、技术跨界融合创新
Oplg: new generation cloud primary observable best practices
Yyds dry goods counting flag variable rule
Shenkaihong News Studio opened for the first time to witness the whole process of the growth of the times
Application of safe electricity management platform in Jingbian Museum safe electricity management system
Processus d'analyse et de configuration du matériel IIC pour le développement de la machine nue imx6ull
Live broadcast software | IPTV live broadcast software | TV live broadcast | tvplayer IPTV easyplayer | youwo live broadcast | customized development of super live broadcast software
Can you really cross with a k-fold? Thoughts on k-fold intersection
Research and application of power monitoring system for employee apartment building construction project
Generating class diagram with EA reverse engineering code
Design and application of intelligent lighting control system in hospital
Get in the car, the era of intelligent database autonomy has come, and Tencent cloud database x AI has made a new breakthrough
员工公寓楼建设项目电力监控系统的研究与应用
What kind of project is suitable for automated testing?
移动端京东商城
tdengine集群安装部署
Research and application of power monitoring system in sports training center