Call this to create a new client You can then call SetRequestURI, SetMethod, SetHeaders, and SetBody after creating the client
()
| 44 | // You can then call SetRequestURI, SetMethod, SetHeaders, and SetBody |
| 45 | // after creating the client |
| 46 | func NewClient() *Client { |
| 47 | return &Client{ |
| 48 | Client: http.DefaultClient, |
| 49 | req: &Request{ |
| 50 | jsonEncoder: json.Marshal, |
| 51 | }, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // NewClientWithTimeout returns a new client with a timeout |
| 56 | func NewClientWithTimeout(timeout time.Duration) *Client { |
no outgoing calls