Home | History | Annotate | Download | only in http

Lines Matching refs:Client

5 // HTTP client. See RFC 2616.
7 // This is the high-level Client interface.
27 // A Client is an HTTP client. Its zero value (DefaultClient) is a
28 // usable client that uses DefaultTransport.
30 // The Client's Transport typically has internal state (cached TCP
34 // A Client is higher-level than a RoundTripper (such as Transport)
38 // When following redirects, the Client will forward all headers set on the
56 type Client struct {
63 // If CheckRedirect is not nil, the client calls it before
66 // first. If CheckRedirect returns an error, the Client's Get
74 // If CheckRedirect is nil, the Client uses its default policy,
83 // redirect that the Client follows.
90 // Client. The timeout includes connection time, any
97 // The Client cancels requests to the underlying Transport
99 // to Client.Do may still set Request.Cancel; both will
102 // For compatibility, the Client will also use the deprecated
109 // DefaultClient is the default Client and is used by Get, Head, and Post.
110 var DefaultClient = &Client{}
167 func (c *Client) send(req *Request, deadline time.Time) (resp *Response, didTimeout func() bool, err error) {
185 func (c *Client) deadline() time.Time {
192 func (c *Client) transport() RoundTripper {
206 return nil, alwaysFalse, errors.New("http: no Client.Transport or DefaultTransport")
216 return nil, alwaysFalse, errors.New("http: Request.RequestURI can't be set in client requests.")
260 err = errors.New("http: server gave HTTP response to HTTPS client")
336 // "To receive authorization, the client sends the userid and password,
372 // Client's CheckRedirect function:
380 // An error is returned if the Client's CheckRedirect function fails
387 // To make a request with custom headers, use NewRequest and Client.Do.
388 func (c *Client) Get(url string) (resp *Response, err error) {
398 // ErrUseLastResponse can be returned by Client.CheckRedirect hooks to
406 func (c *Client) checkRedirect(req *Request, via []*Request) error {
415 // client encounters a 3xx status code from the server
459 // client.
461 // An error is returned if caused by client policy (such as
468 // closed, the Client's underlying RoundTripper (typically Transport)
481 // If the server replies with a redirect, the Client first uses the
490 func (c *Client) Do(req *Request) (*Response, error) {
598 err: err.Error() + " (Client.Timeout exceeded while awaiting headers)",
618 func (c *Client) makeHeadersCopier(ireq *Request) func(*Request) {
697 // See the Client.Do method documentation for details on how redirects
710 // To set custom headers, use NewRequest and Client.Do.
712 // See the Client.Do method documentation for details on how redirects
714 func (c *Client) Post(url string, contentType string, body io.Reader) (resp *Response, err error) {
734 // See the Client.Do method documentation for details on how redirects
749 // See the Client.Do method documentation for details on how redirects
751 func (c *Client) PostForm(url string, data url.Values) (resp *Response, err error) {
772 // Client's CheckRedirect function:
779 func (c *Client) Head(url string) (resp *Response, err error) {
808 err: err.Error() + " (Client.Timeout exceeded while reading body)",
830 // client request. Cookies automatically added via the