1 Star 1 Fork 1

up-zero/gotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
http_test.go 868 Bytes
一键复制 编辑 原始数据 按行查看 历史
GetcharZp 提交于 2024-03-22 19:14 +08:00 . fix support http request with timeout
package gotool
import (
"testing"
"time"
)
func TestHttpGet(t *testing.T) {
t.Log(HttpGet("http://getcharzp.cn"))
}
func TestHttpPost(t *testing.T) {
t.Log(HttpPost("http://baidu.com", []byte("")))
}
func TestHttpPut(t *testing.T) {
t.Log(HttpPut("http://baidu.com", []byte("")))
}
func TestHttpDelete(t *testing.T) {
t.Log(HttpDelete("http://baidu.com", []byte("")))
}
func TestHttpGetWithTimeout(t *testing.T) {
t.Log(HttpGetWithTimeout("http://getcharzp.cn", 10*time.Second))
}
func TestHttpPostWithTimeout(t *testing.T) {
t.Log(HttpPostWithTimeout("http://baidu.com", []byte(""), 10*time.Second))
}
func TestHttpPutWithTimeout(t *testing.T) {
t.Log(HttpPutWithTimeout("http://baidu.com", []byte(""), 10*time.Second))
}
func TestHttpDeleteWithTimeout(t *testing.T) {
t.Log(HttpDeleteWithTimeout("http://baidu.com", []byte(""), 10*time.Second))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/up-zero/gotool.git
git@gitee.com:up-zero/gotool.git
up-zero
gotool
gotool
main

搜索帮助