Execute 发送请求
()
| 13 | |
| 14 | // Execute 发送请求 |
| 15 | func (h *Http) Execute() *Http { |
| 16 | defer func() { |
| 17 | if err := recover(); err != nil { |
| 18 | log.Println("recover: ", err) |
| 19 | } |
| 20 | }() |
| 21 | if h.err != nil { |
| 22 | log.Println("[!] Pre Http.Execute(): ", h.err) |
| 23 | return nil |
| 24 | } |
| 25 | |
| 26 | //fmt.Printf("HttpTransport: %p \n", h.HttpTransport) |
| 27 | var err error |
| 28 | // h.HttpClient.Transport = h.HttpTransport |
| 29 | h.HttpResponse, err = h.HttpClient.Do(h.HttpRequest) |
| 30 | if err != nil { |
| 31 | log.Println("[!] Http Execute Error : ", err) |
| 32 | h.err = err |
| 33 | return h |
| 34 | } |
| 35 | return h |
| 36 | } |
| 37 | |
| 38 | // Close 关闭请求与body |
| 39 | func (h *Http) Close() *Http { |
no outgoing calls