Close 关闭请求与body
()
| 37 | |
| 38 | // Close 关闭请求与body |
| 39 | func (h *Http) Close() *Http { |
| 40 | defer func() { |
| 41 | if err := recover(); err != nil { |
| 42 | log.Println(err) |
| 43 | } |
| 44 | }() |
| 45 | if h.HttpResponse != nil { |
| 46 | //log.Println("CLose(): ", h.HttpResponse.Body) |
| 47 | //h.readAll() |
| 48 | h.readNull() |
| 49 | h.HttpResponse = nil |
| 50 | } |
| 51 | |
| 52 | if h.CtxCancel != nil { |
| 53 | h.CtxCancel() |
| 54 | } |
| 55 | return h |
| 56 | } |
| 57 | |
| 58 | // GetRespHead 获取返回头 |
| 59 | func (h *Http) GetRespHead(key string) string { |