| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -5,8 +5,6 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					package httplib | 
					 | 
					 | 
					 | 
					package httplib | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// NOTE: last sync 57e62e5 on Oct 29, 2014.
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import ( | 
					 | 
					 | 
					 | 
					import ( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						"bytes" | 
					 | 
					 | 
					 | 
						"bytes" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						"crypto/tls" | 
					 | 
					 | 
					 | 
						"crypto/tls" | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -27,7 +25,7 @@ import ( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						"time" | 
					 | 
					 | 
					 | 
						"time" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					) | 
					 | 
					 | 
					 | 
					) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					var defaultSetting = BeegoHttpSettings{false, "beegoServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false} | 
					 | 
					 | 
					 | 
					var defaultSetting = Settings{false, "GogsServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false} | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					var defaultCookieJar http.CookieJar | 
					 | 
					 | 
					 | 
					var defaultCookieJar http.CookieJar | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					var settingMutex sync.Mutex | 
					 | 
					 | 
					 | 
					var settingMutex sync.Mutex | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -39,7 +37,7 @@ func createDefaultCookie() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Overwrite default settings
 | 
					 | 
					 | 
					 | 
					// Overwrite default settings
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func SetDefaultSetting(setting BeegoHttpSettings) { | 
					 | 
					 | 
					 | 
					func SetDefaultSetting(setting Settings) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						settingMutex.Lock() | 
					 | 
					 | 
					 | 
						settingMutex.Lock() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						defer settingMutex.Unlock() | 
					 | 
					 | 
					 | 
						defer settingMutex.Unlock() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						defaultSetting = setting | 
					 | 
					 | 
					 | 
						defaultSetting = setting | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -51,8 +49,8 @@ func SetDefaultSetting(setting BeegoHttpSettings) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// return *BeegoHttpRequest with specific method
 | 
					 | 
					 | 
					 | 
					// return *Request with specific method
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func newBeegoRequest(url, method string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func newBeegoRequest(url, method string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						var resp http.Response | 
					 | 
					 | 
					 | 
						var resp http.Response | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						req := http.Request{ | 
					 | 
					 | 
					 | 
						req := http.Request{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							Method:     method, | 
					 | 
					 | 
					 | 
							Method:     method, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -61,36 +59,35 @@ func newBeegoRequest(url, method string) *BeegoHttpRequest { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							ProtoMajor: 1, | 
					 | 
					 | 
					 | 
							ProtoMajor: 1, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							ProtoMinor: 1, | 
					 | 
					 | 
					 | 
							ProtoMinor: 1, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 
					 | 
					 | 
					 | 
						return &Request{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Get returns *BeegoHttpRequest with GET method.
 | 
					 | 
					 | 
					 | 
					// Get returns *Request with GET method.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func Get(url string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func Get(url string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "GET") | 
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "GET") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Post returns *BeegoHttpRequest with POST method.
 | 
					 | 
					 | 
					 | 
					// Post returns *Request with POST method.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func Post(url string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func Post(url string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "POST") | 
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "POST") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Put returns *BeegoHttpRequest with PUT method.
 | 
					 | 
					 | 
					 | 
					// Put returns *Request with PUT method.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func Put(url string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func Put(url string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "PUT") | 
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "PUT") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Delete returns *BeegoHttpRequest DELETE method.
 | 
					 | 
					 | 
					 | 
					// Delete returns *Request DELETE method.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func Delete(url string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func Delete(url string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "DELETE") | 
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "DELETE") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Head returns *BeegoHttpRequest with HEAD method.
 | 
					 | 
					 | 
					 | 
					// Head returns *Request with HEAD method.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func Head(url string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func Head(url string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "HEAD") | 
					 | 
					 | 
					 | 
						return newBeegoRequest(url, "HEAD") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// BeegoHttpSettings
 | 
					 | 
					 | 
					 | 
					type Settings struct { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					type BeegoHttpSettings struct { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						ShowDebug        bool | 
					 | 
					 | 
					 | 
						ShowDebug        bool | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						UserAgent        string | 
					 | 
					 | 
					 | 
						UserAgent        string | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						ConnectTimeout   time.Duration | 
					 | 
					 | 
					 | 
						ConnectTimeout   time.Duration | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -101,93 +98,97 @@ type BeegoHttpSettings struct { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						EnableCookie     bool | 
					 | 
					 | 
					 | 
						EnableCookie     bool | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// BeegoHttpRequest provides more useful methods for requesting one url than http.Request.
 | 
					 | 
					 | 
					 | 
					// HttpRequest provides more useful methods for requesting one url than http.Request.
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					type BeegoHttpRequest struct { | 
					 | 
					 | 
					 | 
					type Request struct { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						url     string | 
					 | 
					 | 
					 | 
						url     string | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						req     *http.Request | 
					 | 
					 | 
					 | 
						req     *http.Request | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						params  map[string]string | 
					 | 
					 | 
					 | 
						params  map[string]string | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						files   map[string]string | 
					 | 
					 | 
					 | 
						files   map[string]string | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						setting BeegoHttpSettings | 
					 | 
					 | 
					 | 
						setting Settings | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						resp    *http.Response | 
					 | 
					 | 
					 | 
						resp    *http.Response | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						body    []byte | 
					 | 
					 | 
					 | 
						body    []byte | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Change request settings
 | 
					 | 
					 | 
					 | 
					// Change request settings
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Setting(setting BeegoHttpSettings) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) Setting(setting Settings) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting = setting | 
					 | 
					 | 
					 | 
						r.setting = setting | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
 | 
					 | 
					 | 
					 | 
					// SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetBasicAuth(username, password string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetBasicAuth(username, password string) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.req.SetBasicAuth(username, password) | 
					 | 
					 | 
					 | 
						r.req.SetBasicAuth(username, password) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetEnableCookie sets enable/disable cookiejar
 | 
					 | 
					 | 
					 | 
					// SetEnableCookie sets enable/disable cookiejar
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetEnableCookie(enable bool) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetEnableCookie(enable bool) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.EnableCookie = enable | 
					 | 
					 | 
					 | 
						r.setting.EnableCookie = enable | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetUserAgent sets User-Agent header field
 | 
					 | 
					 | 
					 | 
					// SetUserAgent sets User-Agent header field
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetUserAgent(useragent string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetUserAgent(useragent string) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.UserAgent = useragent | 
					 | 
					 | 
					 | 
						r.setting.UserAgent = useragent | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Debug sets show debug or not when executing request.
 | 
					 | 
					 | 
					 | 
					// Debug sets show debug or not when executing request.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) Debug(isdebug bool) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.ShowDebug = isdebug | 
					 | 
					 | 
					 | 
						r.setting.ShowDebug = isdebug | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetTimeout sets connect time out and read-write time out for BeegoRequest.
 | 
					 | 
					 | 
					 | 
					// SetTimeout sets connect time out and read-write time out for BeegoRequest.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.ConnectTimeout = connectTimeout | 
					 | 
					 | 
					 | 
						r.setting.ConnectTimeout = connectTimeout | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.ReadWriteTimeout = readWriteTimeout | 
					 | 
					 | 
					 | 
						r.setting.ReadWriteTimeout = readWriteTimeout | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetTLSClientConfig sets tls connection configurations if visiting https url.
 | 
					 | 
					 | 
					 | 
					// SetTLSClientConfig sets tls connection configurations if visiting https url.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetTLSClientConfig(config *tls.Config) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetTLSClientConfig(config *tls.Config) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.TlsClientConfig = config | 
					 | 
					 | 
					 | 
						r.setting.TlsClientConfig = config | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Header add header item string in request.
 | 
					 | 
					 | 
					 | 
					// Header add header item string in request.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) Header(key, value string) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.req.Header.Set(key, value) | 
					 | 
					 | 
					 | 
						r.req.Header.Set(key, value) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					func (r *Request) Headers() http.Header { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						return r.req.Header | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Set the protocol version for incoming requests.
 | 
					 | 
					 | 
					 | 
					// Set the protocol version for incoming requests.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Client requests always use HTTP/1.1.
 | 
					 | 
					 | 
					 | 
					// Client requests always use HTTP/1.1.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetProtocolVersion(vers string) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if len(vers) == 0 { | 
					 | 
					 | 
					 | 
						if len(vers) == 0 { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							vers = "HTTP/1.1" | 
					 | 
					 | 
					 | 
							vers = "HTTP/1.1" | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						major, minor, ok := http.ParseHTTPVersion(vers) | 
					 | 
					 | 
					 | 
						major, minor, ok := http.ParseHTTPVersion(vers) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if ok { | 
					 | 
					 | 
					 | 
						if ok { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.Proto = vers | 
					 | 
					 | 
					 | 
							r.req.Proto = vers | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.ProtoMajor = major | 
					 | 
					 | 
					 | 
							r.req.ProtoMajor = major | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.ProtoMinor = minor | 
					 | 
					 | 
					 | 
							r.req.ProtoMinor = minor | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// SetCookie add cookie into request.
 | 
					 | 
					 | 
					 | 
					// SetCookie add cookie into request.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetCookie(cookie *http.Cookie) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetCookie(cookie *http.Cookie) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.req.Header.Add("Cookie", cookie.String()) | 
					 | 
					 | 
					 | 
						r.req.Header.Add("Cookie", cookie.String()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Set transport to
 | 
					 | 
					 | 
					 | 
					// Set transport to
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetTransport(transport http.RoundTripper) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetTransport(transport http.RoundTripper) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.Transport = transport | 
					 | 
					 | 
					 | 
						r.setting.Transport = transport | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Set http proxy
 | 
					 | 
					 | 
					 | 
					// Set http proxy
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -197,47 +198,47 @@ func (b *BeegoHttpRequest) SetTransport(transport http.RoundTripper) *BeegoHttpR | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// 		u, _ := url.ParseRequestURI("http://127.0.0.1:8118")
 | 
					 | 
					 | 
					 | 
					// 		u, _ := url.ParseRequestURI("http://127.0.0.1:8118")
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// 		return u, nil
 | 
					 | 
					 | 
					 | 
					// 		return u, nil
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// 	}
 | 
					 | 
					 | 
					 | 
					// 	}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) SetProxy(proxy func(*http.Request) (*url.URL, error)) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.setting.Proxy = proxy | 
					 | 
					 | 
					 | 
						r.setting.Proxy = proxy | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Param adds query param in to request.
 | 
					 | 
					 | 
					 | 
					// Param adds query param in to request.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// params build query string as ?key1=value1&key2=value2...
 | 
					 | 
					 | 
					 | 
					// params build query string as ?key1=value1&key2=value2...
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Param(key, value string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) Param(key, value string) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.params[key] = value | 
					 | 
					 | 
					 | 
						r.params[key] = value | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) PostFile(formname, filename string) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) PostFile(formname, filename string) *Request { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.files[formname] = filename | 
					 | 
					 | 
					 | 
						r.files[formname] = filename | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Body adds request raw body.
 | 
					 | 
					 | 
					 | 
					// Body adds request raw body.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it supports string and []byte.
 | 
					 | 
					 | 
					 | 
					// it supports string and []byte.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest { | 
					 | 
					 | 
					 | 
					func (r *Request) Body(data interface{}) *Request { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						switch t := data.(type) { | 
					 | 
					 | 
					 | 
						switch t := data.(type) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						case string: | 
					 | 
					 | 
					 | 
						case string: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							bf := bytes.NewBufferString(t) | 
					 | 
					 | 
					 | 
							bf := bytes.NewBufferString(t) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.Body = ioutil.NopCloser(bf) | 
					 | 
					 | 
					 | 
							r.req.Body = ioutil.NopCloser(bf) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.ContentLength = int64(len(t)) | 
					 | 
					 | 
					 | 
							r.req.ContentLength = int64(len(t)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						case []byte: | 
					 | 
					 | 
					 | 
						case []byte: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							bf := bytes.NewBuffer(t) | 
					 | 
					 | 
					 | 
							bf := bytes.NewBuffer(t) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.Body = ioutil.NopCloser(bf) | 
					 | 
					 | 
					 | 
							r.req.Body = ioutil.NopCloser(bf) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.ContentLength = int64(len(t)) | 
					 | 
					 | 
					 | 
							r.req.ContentLength = int64(len(t)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b | 
					 | 
					 | 
					 | 
						return r | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { | 
					 | 
					 | 
					 | 
					func (r *Request) getResponse() (*http.Response, error) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if b.resp.StatusCode != 0 { | 
					 | 
					 | 
					 | 
						if r.resp.StatusCode != 0 { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return b.resp, nil | 
					 | 
					 | 
					 | 
							return r.resp, nil | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						var paramBody string | 
					 | 
					 | 
					 | 
						var paramBody string | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if len(b.params) > 0 { | 
					 | 
					 | 
					 | 
						if len(r.params) > 0 { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							var buf bytes.Buffer | 
					 | 
					 | 
					 | 
							var buf bytes.Buffer | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							for k, v := range b.params { | 
					 | 
					 | 
					 | 
							for k, v := range r.params { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								buf.WriteString(url.QueryEscape(k)) | 
					 | 
					 | 
					 | 
								buf.WriteString(url.QueryEscape(k)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								buf.WriteByte('=') | 
					 | 
					 | 
					 | 
								buf.WriteByte('=') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								buf.WriteString(url.QueryEscape(v)) | 
					 | 
					 | 
					 | 
								buf.WriteString(url.QueryEscape(v)) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -247,18 +248,18 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							paramBody = paramBody[0 : len(paramBody)-1] | 
					 | 
					 | 
					 | 
							paramBody = paramBody[0 : len(paramBody)-1] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if b.req.Method == "GET" && len(paramBody) > 0 { | 
					 | 
					 | 
					 | 
						if r.req.Method == "GET" && len(paramBody) > 0 { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if strings.Index(b.url, "?") != -1 { | 
					 | 
					 | 
					 | 
							if strings.Index(r.url, "?") != -1 { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.url += "&" + paramBody | 
					 | 
					 | 
					 | 
								r.url += "&" + paramBody | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} else { | 
					 | 
					 | 
					 | 
							} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.url = b.url + "?" + paramBody | 
					 | 
					 | 
					 | 
								r.url = r.url + "?" + paramBody | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else if b.req.Method == "POST" && b.req.Body == nil { | 
					 | 
					 | 
					 | 
						} else if r.req.Method == "POST" && r.req.Body == nil { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if len(b.files) > 0 { | 
					 | 
					 | 
					 | 
							if len(r.files) > 0 { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								pr, pw := io.Pipe() | 
					 | 
					 | 
					 | 
								pr, pw := io.Pipe() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								bodyWriter := multipart.NewWriter(pw) | 
					 | 
					 | 
					 | 
								bodyWriter := multipart.NewWriter(pw) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								go func() { | 
					 | 
					 | 
					 | 
								go func() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									for formname, filename := range b.files { | 
					 | 
					 | 
					 | 
									for formname, filename := range r.files { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										fileWriter, err := bodyWriter.CreateFormFile(formname, filename) | 
					 | 
					 | 
					 | 
										fileWriter, err := bodyWriter.CreateFormFile(formname, filename) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										if err != nil { | 
					 | 
					 | 
					 | 
										if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											log.Fatal(err) | 
					 | 
					 | 
					 | 
											log.Fatal(err) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -274,53 +275,53 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
											log.Fatal(err) | 
					 | 
					 | 
					 | 
											log.Fatal(err) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										} | 
					 | 
					 | 
					 | 
										} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									for k, v := range b.params { | 
					 | 
					 | 
					 | 
									for k, v := range r.params { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										bodyWriter.WriteField(k, v) | 
					 | 
					 | 
					 | 
										bodyWriter.WriteField(k, v) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
									} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									bodyWriter.Close() | 
					 | 
					 | 
					 | 
									bodyWriter.Close() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									pw.Close() | 
					 | 
					 | 
					 | 
									pw.Close() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}() | 
					 | 
					 | 
					 | 
								}() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.Header("Content-Type", bodyWriter.FormDataContentType()) | 
					 | 
					 | 
					 | 
								r.Header("Content-Type", bodyWriter.FormDataContentType()) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.req.Body = ioutil.NopCloser(pr) | 
					 | 
					 | 
					 | 
								r.req.Body = ioutil.NopCloser(pr) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} else if len(paramBody) > 0 { | 
					 | 
					 | 
					 | 
							} else if len(paramBody) > 0 { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.Header("Content-Type", "application/x-www-form-urlencoded") | 
					 | 
					 | 
					 | 
								r.Header("Content-Type", "application/x-www-form-urlencoded") | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								b.Body(paramBody) | 
					 | 
					 | 
					 | 
								r.Body(paramBody) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						url, err := url.Parse(b.url) | 
					 | 
					 | 
					 | 
						url, err := url.Parse(r.url) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return nil, err | 
					 | 
					 | 
					 | 
							return nil, err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.req.URL = url | 
					 | 
					 | 
					 | 
						r.req.URL = url | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						trans := b.setting.Transport | 
					 | 
					 | 
					 | 
						trans := r.setting.Transport | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if trans == nil { | 
					 | 
					 | 
					 | 
						if trans == nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							// create default transport
 | 
					 | 
					 | 
					 | 
							// create default transport
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							trans = &http.Transport{ | 
					 | 
					 | 
					 | 
							trans = &http.Transport{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								TLSClientConfig: b.setting.TlsClientConfig, | 
					 | 
					 | 
					 | 
								TLSClientConfig: r.setting.TlsClientConfig, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								Proxy:           b.setting.Proxy, | 
					 | 
					 | 
					 | 
								Proxy:           r.setting.Proxy, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								Dial:            TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout), | 
					 | 
					 | 
					 | 
								Dial:            TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout), | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} else { | 
					 | 
					 | 
					 | 
						} else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							// if b.transport is *http.Transport then set the settings.
 | 
					 | 
					 | 
					 | 
							// if r.transport is *http.Transport then set the settings.
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if t, ok := trans.(*http.Transport); ok { | 
					 | 
					 | 
					 | 
							if t, ok := trans.(*http.Transport); ok { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if t.TLSClientConfig == nil { | 
					 | 
					 | 
					 | 
								if t.TLSClientConfig == nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									t.TLSClientConfig = b.setting.TlsClientConfig | 
					 | 
					 | 
					 | 
									t.TLSClientConfig = r.setting.TlsClientConfig | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if t.Proxy == nil { | 
					 | 
					 | 
					 | 
								if t.Proxy == nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									t.Proxy = b.setting.Proxy | 
					 | 
					 | 
					 | 
									t.Proxy = r.setting.Proxy | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if t.Dial == nil { | 
					 | 
					 | 
					 | 
								if t.Dial == nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									t.Dial = TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout) | 
					 | 
					 | 
					 | 
									t.Dial = TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
								} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						var jar http.CookieJar | 
					 | 
					 | 
					 | 
						var jar http.CookieJar | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if b.setting.EnableCookie { | 
					 | 
					 | 
					 | 
						if r.setting.EnableCookie { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if defaultCookieJar == nil { | 
					 | 
					 | 
					 | 
							if defaultCookieJar == nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								createDefaultCookie() | 
					 | 
					 | 
					 | 
								createDefaultCookie() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -334,30 +335,30 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							Jar:       jar, | 
					 | 
					 | 
					 | 
							Jar:       jar, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if len(b.setting.UserAgent) > 0 && len(b.req.Header.Get("User-Agent")) == 0 { | 
					 | 
					 | 
					 | 
						if len(r.setting.UserAgent) > 0 && len(r.req.Header.Get("User-Agent")) == 0 { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							b.req.Header.Set("User-Agent", b.setting.UserAgent) | 
					 | 
					 | 
					 | 
							r.req.Header.Set("User-Agent", r.setting.UserAgent) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if b.setting.ShowDebug { | 
					 | 
					 | 
					 | 
						if r.setting.ShowDebug { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							dump, err := httputil.DumpRequest(b.req, true) | 
					 | 
					 | 
					 | 
							dump, err := httputil.DumpRequest(r.req, true) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if err != nil { | 
					 | 
					 | 
					 | 
							if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								println(err.Error()) | 
					 | 
					 | 
					 | 
								println(err.Error()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							println(string(dump)) | 
					 | 
					 | 
					 | 
							println(string(dump)) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						resp, err := client.Do(b.req) | 
					 | 
					 | 
					 | 
						resp, err := client.Do(r.req) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return nil, err | 
					 | 
					 | 
					 | 
							return nil, err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.resp = resp | 
					 | 
					 | 
					 | 
						r.resp = resp | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return resp, nil | 
					 | 
					 | 
					 | 
						return resp, nil | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// String returns the body string in response.
 | 
					 | 
					 | 
					 | 
					// String returns the body string in response.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) String() (string, error) { | 
					 | 
					 | 
					 | 
					func (r *Request) String() (string, error) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						data, err := b.Bytes() | 
					 | 
					 | 
					 | 
						data, err := r.Bytes() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return "", err | 
					 | 
					 | 
					 | 
							return "", err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -367,11 +368,11 @@ func (b *BeegoHttpRequest) String() (string, error) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Bytes returns the body []byte in response.
 | 
					 | 
					 | 
					 | 
					// Bytes returns the body []byte in response.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Bytes() ([]byte, error) { | 
					 | 
					 | 
					 | 
					func (r *Request) Bytes() ([]byte, error) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if b.body != nil { | 
					 | 
					 | 
					 | 
						if r.body != nil { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return b.body, nil | 
					 | 
					 | 
					 | 
							return r.body, nil | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						resp, err := b.getResponse() | 
					 | 
					 | 
					 | 
						resp, err := r.getResponse() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return nil, err | 
					 | 
					 | 
					 | 
							return nil, err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -383,20 +384,20 @@ func (b *BeegoHttpRequest) Bytes() ([]byte, error) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return nil, err | 
					 | 
					 | 
					 | 
							return nil, err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						b.body = data | 
					 | 
					 | 
					 | 
						r.body = data | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return data, nil | 
					 | 
					 | 
					 | 
						return data, nil | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// ToFile saves the body data in response to one file.
 | 
					 | 
					 | 
					 | 
					// ToFile saves the body data in response to one file.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) ToFile(filename string) error { | 
					 | 
					 | 
					 | 
					func (r *Request) ToFile(filename string) error { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						f, err := os.Create(filename) | 
					 | 
					 | 
					 | 
						f, err := os.Create(filename) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return err | 
					 | 
					 | 
					 | 
							return err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						defer f.Close() | 
					 | 
					 | 
					 | 
						defer f.Close() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						resp, err := b.getResponse() | 
					 | 
					 | 
					 | 
						resp, err := r.getResponse() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return err | 
					 | 
					 | 
					 | 
							return err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -410,8 +411,8 @@ func (b *BeegoHttpRequest) ToFile(filename string) error { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// ToJson returns the map that marshals from the body bytes as json in response .
 | 
					 | 
					 | 
					 | 
					// ToJson returns the map that marshals from the body bytes as json in response .
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) ToJson(v interface{}) error { | 
					 | 
					 | 
					 | 
					func (r *Request) ToJson(v interface{}) error { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						data, err := b.Bytes() | 
					 | 
					 | 
					 | 
						data, err := r.Bytes() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return err | 
					 | 
					 | 
					 | 
							return err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -421,8 +422,8 @@ func (b *BeegoHttpRequest) ToJson(v interface{}) error { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// ToXml returns the map that marshals from the body bytes as xml in response .
 | 
					 | 
					 | 
					 | 
					// ToXml returns the map that marshals from the body bytes as xml in response .
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
					 | 
					 | 
					 | 
					// it calls Response inner.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) ToXml(v interface{}) error { | 
					 | 
					 | 
					 | 
					func (r *Request) ToXml(v interface{}) error { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						data, err := b.Bytes() | 
					 | 
					 | 
					 | 
						data, err := r.Bytes() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if err != nil { | 
					 | 
					 | 
					 | 
						if err != nil { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return err | 
					 | 
					 | 
					 | 
							return err | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -431,8 +432,8 @@ func (b *BeegoHttpRequest) ToXml(v interface{}) error { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// Response executes request client gets response mannually.
 | 
					 | 
					 | 
					 | 
					// Response executes request client gets response mannually.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					func (b *BeegoHttpRequest) Response() (*http.Response, error) { | 
					 | 
					 | 
					 | 
					func (r *Request) Response() (*http.Response, error) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return b.getResponse() | 
					 | 
					 | 
					 | 
						return r.getResponse() | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					// TimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.
 | 
					 | 
					 | 
					 | 
					// TimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |