-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.go
More file actions
32 lines (29 loc) · 778 Bytes
/
Copy pathclient.go
File metadata and controls
32 lines (29 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package inet
import (
"io"
"net/http"
"net/url"
"time"
)
// Client is an interface defining required functions for an HTTP
// client.
type Client interface {
// The following functions mirror net/http functions.
Do(req *http.Request) (*http.Response, error)
Get(uri string) (*http.Response, error)
Head(uri string) (*http.Response, error)
Post(
uri string,
contentType string,
body io.Reader,
) (*http.Response, error)
PostForm(uri string, form url.Values) (*http.Response, error)
// These functions are unique to this module.
Debug(enable bool) Client
Jar() http.CookieJar
SetJar(jar http.CookieJar) Client
SetTimeout(timeout time.Duration) Client
SetTransport(trans http.RoundTripper) Client
Timeout() time.Duration
Transport() http.RoundTripper
}