当前位置:网站首页>[golang] golang implements the post request to send form type data function
[golang] golang implements the post request to send form type data function
2022-07-24 11:12:00 【Taoshihan】
golang Realization post Request to send form Type data function
// send out http post Request data is form
func PostForm(url string, data url.Values) (string, error) {
resp, err := http.PostForm(url, data)
if err != nil {
return "", err
}
defer resp.Body.Close()
content, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
return string(content), nil
}Use as follows :
data := url.Values{}
data.Set("phone", phone)
data.Set("password", password)
data.Set("host", host)
res, err := PostForm("/xxxxxxx", data)边栏推荐
- Exceptions about configuring Postgres parameters
- 【10】团队协作和跨团队协作
- 神器 ffmpeg —— 操作视频,极度舒适
- Publish local image to private library
- Data visualization - White Snake 2: black snake robbery (1)
- Fiddler抓包工具总结
- JS tree structure, find out the parent set of each layer it belongs to according to the ID of the inner layer
- Redistribution distributed lock types
- Over the weekend, I had a dinner with the technology gurus and talked about the "golden nine and silver ten" peak of the software testing industry [the trend of involution has been formed]
- Xilinx FPGA soft core development process
猜你喜欢

【攻防世界WEB】难度五星15分进阶题:ics-07

爬虫与反爬:一场无休止之战

如何从功能测试到自动化测试?

【白帽子讲Web安全】第二章 浏览器安全

自学软件测试天赋异禀——不是盖的

Value and technical thinking of vectorization engine for HTAP

Use Modelsim to independently simulate Altera and Xilinx IP cores

"Low power Bluetooth module" master-slave integrated Bluetooth sniffer - help smart door lock

rs485通信OSI模型网络层

Working principle and function application of frequency converter
随机推荐
RS485 communication OSI model network layer
[FPGA]: IP core -- xadc
Yum installation prompt to protect multi library version
Mockito3.8 how to mock static methods (how to mock PageHelper)
[live registration] analysis of location cache module and detailed explanation of OCP monitoring and alarm
Introduction to kubernetes Basics
This should be postman, the most complete interface testing tool in the whole network
Ldr6028 charging OTG live line live sound card audio adapter is the most cost-effective solution
Altium one key automatic BOM
1184. Distance between bus stops: simple simulation problem
蓝牙模块的5大应用场景
HDU 3351:Seinfeld
系统管理员需知的 16 个 iptables 使用技巧
[white hat talks about web security] Chapter 1 my security world view
Linux redis download and installation
Installing Oracle Xe with Linux
Ask n! How many zeros are there behind
JMeter接口测试步骤-安装教程-脚本录制-并发测试
Simply understand MODBUS function code and partition
在线客服聊天系统源码_美观强大golang内核开发_二进制运行傻瓜式安装_附搭建教程