{"modulePath":"github.com/mapmeld/codemingler","version":"v0.6.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httplib\n\n## Functions\n\n```go\nfunc SetDefaultSetting(setting Settings)\n```\nOverwrite default settings\n\n```go\nfunc TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(net, addr string) (c net.Conn, err error)\n```\nTimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.\n\n## Types\n\n```go\ntype Request struct {\n\t// contains filtered or unexported fields\n}\n```\nHttpRequest provides more useful methods for requesting one url than http.Request.\n\n```go\nfunc Delete(url string) *Request\n```\nDelete returns \\*Request DELETE method.\n\n```go\nfunc Get(url string) *Request\n```\nGet returns \\*Request with GET method.\n\n```go\nfunc Head(url string) *Request\n```\nHead returns \\*Request with HEAD method.\n\n```go\nfunc Post(url string) *Request\n```\nPost returns \\*Request with POST method.\n\n```go\nfunc Put(url string) *Request\n```\nPut returns \\*Request with PUT method.\n\n```go\nfunc (r *Request) Body(data interface{}) *Request\n```\nBody adds request raw body. it supports string and \\[]byte.\n\n```go\nfunc (r *Request) Bytes() ([]byte, error)\n```\nBytes returns the body \\[]byte in response. it calls Response inner.\n\n```go\nfunc (r *Request) Debug(isdebug bool) *Request\n```\nDebug sets show debug or not when executing request.\n\n```go\nfunc (r *Request) Header(key, value string) *Request\n```\nHeader add header item string in request.\n\n```go\nfunc (r *Request) Headers() http.Header\n```\n\n```go\nfunc (r *Request) Param(key, value string) *Request\n```\nParam adds query param in to request. params build query string as ?key1=value1\u0026key2=value2...\n\n```go\nfunc (r *Request) PostFile(formname, filename string) *Request\n```\n\n```go\nfunc (r *Request) Response() (*http.Response, error)\n```\nResponse executes request client gets response mannually.\n\n```go\nfunc (r *Request) SetBasicAuth(username, password string) *Request\n```\nSetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.\n\n```go\nfunc (r *Request) SetCookie(cookie *http.Cookie) *Request\n```\nSetCookie add cookie into request.\n\n```go\nfunc (r *Request) SetEnableCookie(enable bool) *Request\n```\nSetEnableCookie sets enable/disable cookiejar\n\n```go\nfunc (r *Request) SetProtocolVersion(vers string) *Request\n```\nSet the protocol version for incoming requests. Client requests always use HTTP/1.1.\n\n```go\nfunc (r *Request) SetProxy(proxy func(*http.Request) (*url.URL, error)) *Request\n```\nSet http proxy example:\n\n\tfunc(req *http.Request) (*url.URL, error) {\n\t\tu, _ := url.ParseRequestURI(\"http://127.0.0.1:8118\")\n\t\treturn u, nil\n\t}\n\n```go\nfunc (r *Request) SetTLSClientConfig(config *tls.Config) *Request\n```\nSetTLSClientConfig sets tls connection configurations if visiting https url.\n\n```go\nfunc (r *Request) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *Request\n```\nSetTimeout sets connect time out and read-write time out for BeegoRequest.\n\n```go\nfunc (r *Request) SetTransport(transport http.RoundTripper) *Request\n```\nSet transport to\n\n```go\nfunc (r *Request) SetUserAgent(useragent string) *Request\n```\nSetUserAgent sets User-Agent header field\n\n```go\nfunc (r *Request) Setting(setting Settings) *Request\n```\nChange request settings\n\n```go\nfunc (r *Request) String() (string, error)\n```\nString returns the body string in response. it calls Response inner.\n\n```go\nfunc (r *Request) ToFile(filename string) error\n```\nToFile saves the body data in response to one file. it calls Response inner.\n\n```go\nfunc (r *Request) ToJson(v interface{}) error\n```\nToJson returns the map that marshals from the body bytes as json in response . it calls Response inner.\n\n```go\nfunc (r *Request) ToXml(v interface{}) error\n```\nToXml returns the map that marshals from the body bytes as xml in response . it calls Response inner.\n\n```go\ntype Settings struct {\n\tShowDebug        bool\n\tUserAgent        string\n\tConnectTimeout   time.Duration\n\tReadWriteTimeout time.Duration\n\tTlsClientConfig  *tls.Config\n\tProxy            func(*http.Request) (*url.URL, error)\n\tTransport        http.RoundTripper\n\tEnableCookie     bool\n}\n```\n\n","path":"github.com/mapmeld/codemingler/modules/httplib","name":"httplib","synopsis":"","isRedistributable":true}
