HTTP
已收录文章:100篇
-
本篇内容介绍了“Go语言如何使用标准库发起HTTP请求”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔173 收藏
-
goproxy Go HTTP(S)代理库, 支持中间人代理解密HTTPS 项目地址 安装 go get github.com/ouqiang/goproxy 使用 package main import ( "net/http" "time" "github.com/ouqiang/goproxy" ) func main() { proxy := goproxy.New()173 收藏
-
Http Server 代码 go.mod: module goStudy1 go 1.17 main.go: package main import ( "fmt" "os" "strconv" //"github.com/thinkeridea/go-extend/exnet" "io" "log" "net/http" "strings" ) /* 编写一个 HTTP 服务器,4个功能: 1,接166 收藏
-
Golang · Go问答 | 1个月前 | HTTP · net/http · Go问答 · 流式响应 · ResponseController · net/http FLUSH 流式响应 Go问答 ResponseController FullDuplex 写超时用问答方式解释 Go net/http ResponseController 的定位、Flush、写入 deadline、FullDuplex 支持边界、兼容兜底和生产使用注意事项。161 收藏
-
最近因为换了Mac,以前的Linux基本上不再使用了,但是我的SS代理还得用。SS代理大家都了解,一个很NB的socks代理工具,但是就是因为他是Socks的,想用HTTP代理的时候很不方便。 以前在Linux下的150 收藏
-
验证码(CAPTCHA)是“Completely Automated Public Turing test to tell Computers and Humans Apart”(全自动区分 计算机 和人类的 图灵测试 )的缩写,是一种区分用户是计算机还是人的公共全自动 程序 。可140 收藏
-
分片读取http超大文件流 Golang中的HTTP发送get请求,在获取内容有两种情况。 Golang发送http get请求方式 resp, err := http.Get(sendUrl) if err != nil { fmt.Println("出错", err) return } 第一种方式是直接全部140 收藏
-
1. Http标准库 1.1 http客户端 func main() { response, err := http.Get("https://www.imooc.com") if err != nil { return } defer response.Body.Close() bytes, err := httputil.DumpResponse(response, true) if err != nil { return } fmt.Printf("%139 收藏
-
比如,我们要发起类似这样一个请求,看起来很简单,实际写起来还是比较繁琐的。 POST /articles/5/update?device=ios HTTP/1.1 Host: go-zero.dev Authorization: Bearer <jwt-token> {"author":"kevin","body":"this is not im122 收藏
-
Golang · Go问答 | 1个月前 | goroutine · HTTP · Context · 超时控制 · Go问答 · WithTimeout Go问答 context取消 QueryContext HTTP请求取消 goroutine退出Go HTTP 请求断开后,r.Context() 会收到取消信号,但服务端慢任务不会凭空停止。只有把 context 继续传给数据库、下游 HTTP 调用、消息消费和 goroutine,取消与超时才会真正变成资源释放动作。120 收藏
-
我就废话不多说了,大家还是直接看代码吧~ package main import ( "fmt" "net/url" ) // Manage the HTTP GET request parameters type GetRequest struct { urls url.Values } // Initializer func (p *GetRequest) Init() *GetRequest { p.urls =119 收藏
-
前言 对于Golang来说,实现一个简单的 http server 非常容易,只需要短短几行代码。同时有了协程的加持,Go实现的 http server 能够取得非常优秀的性能。这篇文章将会对go标准库 net/http 实现http服务116 收藏