Comments (4)
测试一下resp.Status != 200时候,是不是导致错误
from go-httpclient.
resp.Status != 200并不认为是错误,body还是有的,通过ToString
也可以取得对应的响应
from go-httpclient.
在什么情况下会没有body,昨天我用了,估计是没有读到body,也没有出现错误,导致后面对body的处理失败,程序退出了
发件人: dong
发送时间: 2014-08-13 05:45
收件人: ddliu/go-httpclient
抄送: suntsh
主题: Re: [go-httpclient] 404的错误 (#2)
resp.Status != 200并不认为是错误,body还是有的,通过ToString也可以取得对应的响应
—
Reply to this email directly or view it on GitHub.
from go-httpclient.
res, err := client.Get(url, nil)
if err == nil {
// res.Body might be nil
} else {
fmt.Println(res.ToString())
}
from go-httpclient.
Related Issues (20)
- post 怎么传数组? HOT 1
- hasOption
- 怎么取消正在请求的client HOT 2
- Concurrency error
- master 分支最新版本能不能打个tag呢? HOT 1
- keep-alive HOT 1
- Add PatchJson as a convenience method
- can i DumpRequest except file HOT 1
- cookie helper feature HOT 1
- Post throw panic when content-type is not kv HOT 5
- 对于defaultClient同时使用并发和非并发方式会导致panic HOT 2
- Basic Auth utility feature
- What request parameters can be customized? HOT 1
- 关于无法携带 TLS 证书这件事 HOT 2
- socket: too many open files HOT 1
- can you add OPT_AFTER_REQUEST_FUNC
- defaultClient concurrency is not safe HOT 2
- I/o timeout HOT 3
- deadlock when using Begin() with PostJson() HOT 1
- default Transport MaxIdleConnsPerHost use DefaultMaxIdleConnsPerHost is lower
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-httpclient.