代码拉取完成,页面将自动刷新
package GoCurlTool
import (
"io/ioutil"
"net/http"
)
type Response struct {
Raw *http.Response
Headers map[string]string
Body string
}
func NewResponse() *Response {
return &Response{}
}
func (this *Response) IsOk() bool {
return this.Raw.StatusCode == 200
}
func (this *Response) parseHeaders() error {
headers := map[string]string{}
for k, v := range this.Raw.Header {
headers[k] = v[0]
}
this.Headers = headers
return nil
}
func (this *Response) parseBody() error {
if body, err := ioutil.ReadAll(this.Raw.Body); err != nil {
panic(err)
} else {
this.Body = string(body)
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。