当前位置:网站首页>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
边栏推荐
- Live broadcast software | IPTV live broadcast software | TV live broadcast | tvplayer IPTV easyplayer | youwo live broadcast | customized development of super live broadcast software
- [HCTF 2018]admin
- Why should I object to DBA's participation in business (issuing reports / changing data)
- 德勤2022技术趋势:IT自我颠覆、技术跨界融合创新
- The origin explanation and use example of image pre training model
- API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
- Acrel-3200远程预付费电能管理系统 在福州万宝产业园的应用
- What is October 24th? Why are there no senior programmers in China in their fifties and sixties, while foreigners,,, Yu Nianyu Hui take you to celebrate the 1024 programmer Festival
- [what is istio?] You're out before you know it. You can understand it quickly in 40 minutes
- How to become a real digital enterprise? Ruijie network releases the digital force awakening plan
猜你喜欢

Amazon Aurora's ability to read and write: shardingsphere proxy

DCB "first brother" xianruida, what does it rely on to raise the value curve?

gin -get请求的小示例1-Handle处理GET请求

Lightly: a new generation of go IDE

How to become a real digital enterprise? Ruijie network releases the digital force awakening plan
![Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]](/img/40/2b2f869b9f196318d35903444c09c9.png)
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]

Selection and evolution of microservices under cloud native architecture

Workplace PUA, five sins of managers
![[Blue Bridge Cup real question 18] scratch addition multiple-choice question youth group scratch Blue Bridge Cup real question and answer explanation](/img/c6/88f1e1712823ec8fdefdbaedcb1b20.png)
[Blue Bridge Cup real question 18] scratch addition multiple-choice question youth group scratch Blue Bridge Cup real question and answer explanation

Acrel-5000型建筑能耗监测系统在西咸空港花园项目的研究与应用
随机推荐
德勤2022技术趋势:IT自我颠覆、技术跨界融合创新
IMX6ULL裸机开发之EPIT周期性定时器分析及配置过程
Analysis of uboot directory structure
[Blue Bridge Cup real question 18] scratch addition multiple-choice question youth group scratch Blue Bridge Cup real question and answer explanation
移動端京東商城
VRF in Mina
The complete form of smart home and the development of "small homekit"
GPT general timer analysis and configuration process of imx6ull bare metal development
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
移动端京东商城
What is the lifecycle of automated testing?
What is October 24th? Why are there no senior programmers in China in their fifties and sixties, while foreigners,,, Yu Nianyu Hui take you to celebrate the 1024 programmer Festival
gin -get请求的小示例1-Handle处理GET请求
Software maintenance exercises
Alibaba cloud container & Service Grid product technology trends (202203)
gin--hello
如何成为真正的数字化企业,锐捷网络发布数字原力觉醒计划
Get rid of the "small workshop" of AI production: how to build a cloud native AI platform based on kubernetes
Android本地数据库基础操作|多线程操作数据库|数据库的增删改查|批量插入数据库|线程池基础使用|玉念聿辉
Amazon Aurora's ability to read and write: shardingsphere proxy