{"modulePath":"github.com/moby/docker","version":"v17.12.1-ce-rc2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package request\n\n## Functions\n\n```go\nfunc ContentType(contentType string) func(*http.Request) error\n```\nContentType sets the specified Content-Type request header\n\n```go\nfunc DaemonHost() string\n```\nDaemonHost return the daemon host string for this test execution\n\n```go\nfunc Delete(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)\n```\nDelete creates and execute a DELETE request on the specified host and endpoint, with the specified request modifiers\n\n```go\nfunc Do(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)\n```\nDo creates and execute a request on the specified endpoint, with the specified request modifiers\n\n```go\nfunc DoOnHost(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)\n```\nDoOnHost creates and execute a request on the specified host and endpoint, with the specified request modifiers\n\n```go\nfunc Get(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)\n```\nGet creates and execute a GET request on the specified host and endpoint, with the specified request modifiers\n\n```go\nfunc JSON(req *http.Request) error\n```\nJSON sets the Content-Type request header to json\n\n```go\nfunc JSONBody(data interface{}) func(*http.Request) error\n```\nJSONBody creates a modifier that encodes the specified data to a JSON string and set it as request body. It also sets the Content-Type header of the request.\n\n```go\nfunc Method(method string) func(*http.Request) error\n```\nMethod creates a modifier that sets the specified string as the request method\n\n```go\nfunc New(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Request, error)\n```\nNew creates a new http Request to the specified host and endpoint, with the specified request modifiers\n\n```go\nfunc NewClient() (dclient.APIClient, error)\n```\nNewClient returns a new Docker API client\n\n```go\nfunc NewClientForHost(host string) (dclient.APIClient, error)\n```\nNewClientForHost returns a Docker API client for the host\n\n```go\nfunc NewEnvClientWithVersion(version string) (*dclient.Client, error)\n```\nNewEnvClientWithVersion returns a docker client with a specified version. See: github.com/docker/docker/client \\`NewEnvClient()\\`\n\n```go\nfunc NewHTTPClient(host string) (*http.Client, error)\n```\nNewHTTPClient creates an http client for the specific host\n\n```go\nfunc Post(endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)\n```\nPost creates and execute a POST request on the specified host and endpoint, with the specified request modifiers\n\n```go\nfunc RawContent(reader io.ReadCloser) func(*http.Request) error\n```\nRawContent sets the specified reader as body for the request\n\n```go\nfunc RawString(content string) func(*http.Request) error\n```\nRawString sets the specified string as body for the request\n\n```go\nfunc ReadBody(b io.ReadCloser) ([]byte, error)\n```\nReadBody read the specified ReadCloser content and returns it\n\n```go\nfunc SockConn(timeout time.Duration, daemon string) (net.Conn, error)\n```\nSockConn opens a connection on the specified socket\n\n```go\nfunc SockRequest(method, endpoint string, data interface{}, daemon string, modifiers ...func(*http.Request)) (int, []byte, error)\n```\nSockRequest create a request against the specified host (with method, endpoint and other request modifier) and returns the status code, and the content as an byte slice Deprecated: use request.Do instead\n\n```go\nfunc SockRequestHijack(method, endpoint string, data io.Reader, ct string, daemon string, modifiers ...func(*http.Request)) (net.Conn, *bufio.Reader, error)\n```\nSockRequestHijack creates a connection to specified host (with method, contenttype, …) and returns a hijacked connection and the output as a \\`bufio.Reader\\`\n\n```go\nfunc SockRequestRaw(method, endpoint string, data io.Reader, ct, daemon string, modifiers ...func(*http.Request)) (*http.Response, io.ReadCloser, error)\n```\nSockRequestRaw create a request against the specified host (with method, endpoint and other request modifier) and returns the http response, the output as a io.ReadCloser Deprecated: use request.Do (or Get, Delete, Post) instead\n\n","path":"github.com/moby/docker/integration-cli/request","name":"request","synopsis":"","isRedistributable":true}
