E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
http.Request
http.FileServer修改Header
funcchangeHeaderThenServe(hhttp.Handler)http.HandlerFunc{returnfunc(whttp.ResponseWriter,r*
http.Request
hengshen
·
2024-09-10 16:16
golang 实现http请求调用
packagemainimport("fmt""log""net/http")funcHelloServer(whttp.ResponseWriter,req*
http.Request
){fmt.Println
杨杨小朋友
·
2024-03-05 17:12
golang
http
xcode
beyla使用:golang程序的trace采集和trace context propagation
packagemainimport("fmt""io""log""math/rand""net/http""time")funchandleRequest(rwhttp.ResponseWriter,_*
http.Request
·
2024-02-11 18:47
Python中如何使用urllib3进行http请求 (二)
以下是如何使用urllib3处理异常和错误的示例:importurllib3#创建一个HTTP连接池http=urllib3.PoolManager()try:#发送一个GET请求到URLr=
http.request
soragui
·
2024-02-06 12:13
Python
python
http
开发语言
golang 创建unix socket http服务端
packagemainimport("fmt""net""net/http""os")funcmain(){http.HandleFunc("/",func(whttp.ResponseWriter,r*
http.Request
迷路的羔羊~
·
2024-02-05 10:22
golang
unix
http
Gin源码学习
handleFunc添加到默认服务路由表DefaultServeMux中,来处理http请求funcmain(){http.HandleFunc("/",func(whttp.ResponseWriter,r*
http.Request
WAMiii
·
2024-02-04 07:43
如何用 Golang 实现一个 http server
原生http包实现实现最简单的服务器:packagemainimport("log""net/http")funcsayHello(whttp.ResponseWriter,r*
http.Request
天猫精灵998
·
2024-01-28 14:13
Golang
golang
http
开发语言
Go web:Gorilla
http.request
中封装了一个context.Context。
qingshuiting
·
2024-01-25 23:21
Go新项目-Golang使用RemoteAddr()获取远程主机地址的注意事项(9)
一、问题描述
http.Request
下的方法RemoteAddr()可以获取客户端的地址和端口号,最近的一个项目中用到了这个方法。
ifanatic
·
2024-01-23 04:26
Go
golang
开发语言
后端
docker部署golang服务
创建服务packagemainimport("fmt""net/http")funchandlerHello(whttp.ResponseWriter,r*
http.Request
){fmt.Fprintf
a...Z
·
2024-01-22 15:07
Docker
使用Go语言编写简单的HTTP服务器
packagemainimport("fmt""net/http")funcmain(){//创建一个处理器函数,处理所有对根路径的请求handler:=func(whttp.ResponseWriter,r*
http.Request
华科℡云
·
2024-01-22 13:29
linux
运维
Go实现简易的Web登陆交互
log""net/http""time")typeItemstruct{NamestringPriceint}//登陆页面funcloginhanler(whttp.ResponseWriter,r*
http.Request
剩下的盛夏~
·
2024-01-21 09:59
Go
GO自研微服务框架-路由实现
packagemainimport("fmt""log""net/http")funcmain(){http.HandleFunc("/hello",func(writerhttp.ResponseWriter,request*
http.Request
lisus2007
·
2024-01-12 09:14
Go自研微服务框架
golang
微服务
go http处理post请求
怎么就不是原创了…http.HandleFunc("/post",func(writerhttp.ResponseWriter,request*
http.Request
){//检查是否POST请求ifrequest.Method
xzchaoo
·
2024-01-10 04:22
HTTP
GO
golang 网络编程(8)表单
usernamepassword服务端代码funclogin(whttp.ResponseWriter,r*
http.Request
){fmt.Println("method:"+r.Meth
zidea
·
2024-01-10 03:56
golang利用alpn机制实现优先以http2协议访问服务端
文章目录配置连接池发起请求配置连接池初始化http连接池t1:=&http.Transport{Proxy:func(*
http.Request
)(*url.URL,error){//不读取HTTP_PROXY
百战天王
·
2024-01-05 16:40
golang
自制Web框架:Gee框架
第一步需要实现一个处理器,所谓处理器就是实现了ServeHTTP方法的接口:typehellostruct{}func(h*hello)ServeHTTP(whttp.ResponseWriter,r*
http.Request
scgg
·
2024-01-03 11:52
go
go
go语言服务器教程,使用Go语言实现一个简单的http web服务器
充当处理程序的函数采用http.ResponseWriter和
http.Request
作为参数。
林葭音
·
2023-12-28 02:44
go语言服务器教程
go语言实现http服务器
packagemainimport("log""net/http")funchelthz(whttp.ResponseWriter,r*
http.Request
){iflen(r.Header)>0{fork
chomol
·
2023-12-28 02:14
个人mark
golang
开发语言
后端
Go Web2. 表单Form
处理表单的输入//main.gopackagemainimport("fmt""log""net/http""strings")funclogin(whttp.ResponseWriter,r*
http.Request
副班长国伟
·
2023-12-23 08:29
go-zero开发入门之网关往rpc服务传递数据2
rpc服务传递额外的数据,比如鉴权数据的时候,通过http的header进行:funcAuthMiddleware(nexthttp.HandlerFunc,whttp.ResponseWriter,r*
http.Request
一见
·
2023-12-16 01:33
go-zero
go
golang
rpc
go-zero
Go语言 接口型函数
//只写函数funcmyFunc(whttp.ResponseWriter,r*
http.Request
){w.Write([]byte(r.URL.Path))}//需要写结构体typehttpServerstruct
确实可以
·
2023-12-06 19:33
golang
开发语言
后端
golang之net/http模块学习
文件按时间创建一个固定值的json文件跨域请求处理输出是json开启服务packagemainimport("fmt""net/http")//路由funchandler(whttp.ResponseWriter,r*
http.Request
结城明日奈是我老婆
·
2023-12-05 06:33
golang
golang
http
学习
38.Go HTTP server middleware
中间件的签名应为(http.ResponseWriter,*
http.Request
),即为http.handlerFunc类型。
asdzxc
·
2023-12-05 03:11
iris+vue上传到本地存储【go/iris】
main.gopackagemainimport("fmt""io""net/http""os")//上传视频文件部分funcuploadHandler_video(whttp.ResponseWriter,r*
http.Request
结城明日奈是我老婆
·
2023-12-02 12:54
golang
#
Vue3
vue.js
golang
前端
go接收post来的json数据
catpostHttpServer.gopackagemainimport("fmt""io/ioutil""log""net/http")funcmockWebhook(whttp.ResponseWriter,r*
http.Request
不正经运维君
·
2023-12-01 18:45
go
golang
json
开发语言
golang 实现 websocket 简单示例
packagemainimport("log""net/http""github.com/gorilla/websocket")varupgrader=websocket.Upgrader{CheckOrigin:func(r*
http.Request
彩色代码
·
2023-11-30 09:00
Golang编程语言
websocket
golang
javascript
Go语言 -- Web开发基础学习 net/http包
第一个GoWeb新建go文件hello_world.go写入:packagemainimport("fmt""net/http")funchello(whttp.ResponseWriter,r*
http.Request
冲鸭嘟嘟可
·
2023-11-24 07:06
后端
前端
golang
学习
Go语言基础之基本语法
packagemainimport("fmt""log""net/http")funchandler(whttp.ResponseWriter,r*
http.Request
){s:="你好,世界!"
Davieyang.D.Y
·
2023-11-20 19:08
计算机语言系列
golang
iphone
xcode
Go Web服务开发入门(一) -- 搭建简单web服务器
packagemainimport("fmt""log""net/http")//处理http请求的request和responsefunchello(whttp.ResponseWriter,r*
http.Request
跑不快的兔子
·
2023-11-19 23:29
go语言
go
web
go语言
Go语言基础入门(创建简单HTTP服务器)
packagemainimport"net/http"funchelloWorld(whttp.ResponseWriter,r*
http.Request
){w.Write([]byte("HelloWorld
Merkle
·
2023-11-19 23:57
Golang
服务器
golang
http
[Go语言]SSTI从0到1
LineCTF2022]gotm1.题目源码2.WP1.Go-web基础及示例packagemainimport("fmt""net/http")funcsayHello(whttp.ResponseWriter,r*
http.Request
Elitewa
·
2023-11-13 00:50
CTF
web安全
Go语言从0到1
golang
开发语言
web安全
CTF
数据采集代码示例
,你需要安装一个Lua的爬虫库,例如Luanode或者Lush:```lualocalltn12=require("ltn12")localhttp=require("")localresponse=
http.request
华科℡云
·
2023-11-11 02:13
php
开发语言
golang
Kanna库
以下是LuaHTTP库的一个示例用法:localhttp=require(“socket.http”)localresponse,status,headers=
http.request
(“jshk.com.cn
qq^^614136809
·
2023-11-06 14:07
爬虫
Golang开启http服务的三种方式
v1最简单版直接使用http.HandleFunc(partern,function(http.ResponseWriter,*
http.Request
){})HandleFunc接受两个参数,第一个为路由地址
L千年老妖
·
2023-11-05 13:58
Go语言的创建HTTP服务器
使用Go语言编写的基础HTTP服务器,程序清单如下:packagemainimport("net/http")funchelloWorld(whttp.ResponseWriter,r*
http.Request
DXB2021
·
2023-11-03 20:28
Go语言
服务器
http
golang
Go中原生http服务的实现方式
Go中原生http服务的实现方式方式一typeDemostruct{}func(d*Demo)ServeHTTP(whttp.ResponseWriter,r*
http.Request
){w.Write
饱腹百科
·
2023-10-25 23:38
go
golang
golang搭建http服务
终端执行操作创建好go.modgomodinitgolangpackagegolangimport("fmt""net/http")funcsayHello(whttp.ResponseWriter,r*
http.Request
牧童牵黄牛
·
2023-10-25 18:24
golang
golang
Goroutine的上下文存储
Golang在
http.Request
中提供了一个Context用于存储kv对,我们可以通过这个来存储请求相关的数据。
元家昕
·
2023-10-21 13:57
GO 工程下载依赖操作流程(go mod)
clickhouse-go")funcmain(){fmt.Println("服务启动......")http.HandleFunc("/hello",func(whttp.ResponseWriter,r*
http.Request
高压锅_1220
·
2023-10-18 00:01
golang
开发语言
后端
urllib3
PoolManager实例来处理http请求,该poolmanager处理所有的连接池细节和线程安全事宜.http=urllib3.PoolManager()#request()返回一个HTTPResponse对象.r=
http.request
金刚_30bf
·
2023-10-13 13:10
如何避免nodejs express应用中出现太多的http连接
现象正常情况下,基于nodejs的http通信应用,在发送
http.request
时不管你是否使用agent和timeout/keepAlive,客户端和服务器之间的连接数不会太多。
语言专家
·
2023-10-13 02:52
express
http
网络协议
网络
nodejs内置模块(http,path,process,fs,until...)
目录一、http模块1.1导入内置http模块1.2创建http服务createServer()http.Server()
http.request
()http.get()2.path模块path常见的API
userZgh
·
2023-10-12 12:55
http
javascript
前端
LuatOS-SOC接口文档(air780E)-- http - http 客户端
,且需要在task内使用require"sys"require"sysplus"sys.taskInit(function()sys.wait(1000)localcode,headers,body=
http.request
l531798151
·
2023-10-11 11:40
air780E
air780E
Golang网络编程-RESTFUL方法
、极简WEB服务:HelloWeb.gopackagemainimport("fmt""net/http")funchandler(writerhttp.ResponseWriter,request*
http.Request
beyond_champion
·
2023-10-05 03:24
Golang
Go
Golang
RESTFUL
Golang 发送Post表单请求
准备服务器packagemainimport("fmt""net/http")funcmain(){http.HandleFunc("/tpost",func(whttp.ResponseWriter,r*
http.Request
Rnben
·
2023-09-28 16:43
Go文件上传下载
使用io包和net包实现基于http的文件上传下载funchandleUpload(whttp.ResponseWriter,request*
http.Request
){//文件上传只允许POST方法ifrequest.Method
林博伦
·
2023-09-24 20:39
go 线程限制数量v2 --chatGPT
继上个问答问:若A是处理http请求的makeNames(whttp.ResponseWriter,r*
http.Request
),且makeNames只接收请求,不做返回。
宇文仲竹
·
2023-09-23 09:11
golang
go语言 实现正向代理
packagemainimport("fmt""io""net""net/http""strings")typePxystruct{}func(p*Pxy)ServeHTTP(rwhttp.ResponseWriter,req*
http.Request
CodeCatt
·
2023-09-21 17:49
golang
开发语言
net/http包源码解读
http.HandleFunc("/",index)log.Fatal(http.ListenAndServe("localhost:8000",nil))}funcindex(whttp.ResponseWriter,r*
http.Request
zzy979
·
2023-09-16 18:19
Go
go
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他