惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
The Blog of Author Tim Ferriss
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tor Project blog
S
Schneier on Security
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
C
Cisco Blogs
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
D
Docker
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
月光博客
月光博客
量子位
A
Arctic Wolf
博客园 - 叶小钗
L
LINUX DO - 热门话题
J
Java Code Geeks
The Hacker News
The Hacker News
Security Latest
Security Latest
V
Vulnerabilities – Threatpost
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
T
Tenable Blog
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Threat Research - Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
PCI Perspectives
PCI Perspectives
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
O
OpenAI News
P
Privacy International News Feed
P
Privacy & Cybersecurity Law Blog
N
Netflix TechBlog - Medium

博客园 - 悉野

ssh连结vmware中ubuntu的共享文件夹 spring加载冲突问题 spring一个错误修正 抓安卓日记到文件 注册表删除桌面顽固图标 github买的账号无法拉取代码的解决方法 apk常用命令 java服务器异常处理 ES6 学习难度分层 promise原理 材质, 纹理, shader之间的关系 TCP与UDP区别 javascript中=>与function的区别 javascript中函数解析过程 cocos使用fgui 几种服务注册与发现的区别 mybatis测试 向量点乘与叉乘 unity画布3种渲染模式 go学习笔记9(TCP) go学习笔记8(反射) c++简单的线程池 operator new 是 C++ 动态内存分配的核心函数,负责分配原始内存,不调用构造函数 C++的定位放置new(Placement new) go学习笔记7(泛型,文件读写,测试) go学习笔记6(协程与channel,select使用,线程安全,异常处理) go学习笔记5(函数,结构体,自定义类型和类别名,接口) go学习笔记4(数组与切片,map,if,switch,for循环) go学习笔记3(变量定义,输入输出,基本数据类型) go学习笔记2 laya打包的apk版本更新脚本 laya列表滚动问题 laya踩坑记 laya列表时计算具体体子项是列表中第几个 子弹射击 laya给自己画边框 查看laya已经加载的资源 laya spine事件
go学习笔记10(HTTP)
悉野 · 2026-04-16 · via 博客园 - 悉野

http服务.go

package main

import (
    "fmt"
    "net/http"
)

func PageHandler(w http.ResponseWriter, r *http.Request) {
    fmt.Println(r.RequestURI)
    w.Write([]byte("hello world"))
}

func main() {
    http.HandleFunc("/", PageHandler)
    http.ListenAndServe(":8087", nil)
}

http请求.go

package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
)

func main() {
    res, err := http.Get("http://localhost:8087")
    if err != nil {
        fmt.Println("err:", err)
        return
    }
    defer res.Body.Close()
    resBody, err := ioutil.ReadAll(res.Body)
    fmt.Println("client receive:" + string(resBody))
}