当前位置:网站首页>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
边栏推荐
- Open WebRTC Toolkit(OWT) Server User Guide
- IMX6ULL裸机开发之硬件IIC分析及配置过程
- [actf2020 freshman competition]
- [HCTF 2018]admin
- Project manager's thinking mode worth trying: project success equation
- JD side: how can a child thread get the value of the parent thread ThreadLocal? I got...
- Let's talk about ruby
- Fault analysis | federated storage engine table causes the monitoring thread to be in the opening table state
- Alibaba cloud container & Service Grid product technology trends (202203)
- Cai Guoqiang's fireworks NFT debut is as wonderful as fireworks during the day
猜你喜欢

Yyds dry goods counting flag variable rule

flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】

Basic operation of Android local database | multi thread operation database | addition, deletion, modification and query of database | batch insertion into database | basic use of thread pool | Yu nia
![[server data recovery] data recovery case of server crash after the hard disk of the server is flooded](/img/8f/aaa76cf4c578555dfd89c6865c61c2.jpg)
[server data recovery] data recovery case of server crash after the hard disk of the server is flooded

安全用电管理平台在靖边博物馆安全用电管理系统的应用

【Android工程师与智能家居产品的第一次接触③】SmartConfig一键配网在硬件端的具体实现|ESP8266一键配网在Arduino的具体实现|玉念聿辉

Acrel-2000型电力监控系统在兴庆坊新兴广场配电所配电回路用电的实时监控和管理

Get in the car, the era of intelligent database autonomy has come, and Tencent cloud database x AI has made a new breakthrough

世界读书日:18本豆瓣评分9.0以上的IT书值得收藏

What happens when you run the NPM install command?
随机推荐
Android development interview questions collection and sorting (including answers), [work perception]
为企业出海“搭桥”,汇量科技靠什么出圈?
Vs + C realizes that the form input box displays gray text by default
Selection and evolution of microservices under cloud native architecture
Chapter 9 of C language programming (fifth edition of Tan Haoqiang) analysis and answer of exercises for users to establish their own data types
Real time monitoring and management of distribution circuit power consumption of acrel-2000 power monitoring system in xingqingfang Xinxing square distribution substation
Comp1011 programming solution
How to become a real digital enterprise? Ruijie network releases the digital force awakening plan
Xizhi technology Shen Yichen was selected as the "global youth leader" of the world economic forum in Davos in 2022
Tdengine deployment cluster installation
Is 2022 software testing easy to learn? How long will it take? (learning roadmap attached)
Elk setup (IV): monitor MySQL slow query and error log
“自虐神器”一夜爆火:用手柄控制自己的脸,代码自取,后果自负
Shenkaihong News Studio opened for the first time to witness the whole process of the growth of the times
Huawei CDN is fast everywhere
"Open source summer" activity is hot. In the registration, rich bonuses are waiting for you to get!
Enterprises choose to privatize the deployment of IM instant messaging software to fully protect information security!
GPT general timer analysis and configuration process of imx6ull bare metal development
App uses the template message from WeChat official account for message push.
After ten years of testing experience, I have sorted out the most suitable software testing learning guide for you