23457ed2 by astaxie

add sethost

1 parent d7791ba8
...@@ -184,6 +184,12 @@ func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest { ...@@ -184,6 +184,12 @@ func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest {
184 return b 184 return b
185 } 185 }
186 186
187 // Set HOST
188 func (b *BeegoHttpRequest) SetHost(host string) *BeegoHttpRequest {
189 b.req.Host = host
190 return b
191 }
192
187 // Set the protocol version for incoming requests. 193 // Set the protocol version for incoming requests.
188 // Client requests always use HTTP/1.1. 194 // Client requests always use HTTP/1.1.
189 func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest { 195 func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest {
...@@ -253,7 +259,6 @@ func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest { ...@@ -253,7 +259,6 @@ func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest {
253 return b 259 return b
254 } 260 }
255 261
256
257 // JsonBody adds request raw body encoding by JSON. 262 // JsonBody adds request raw body encoding by JSON.
258 func (b *BeegoHttpRequest) JsonBody(obj interface{}) (*BeegoHttpRequest, error) { 263 func (b *BeegoHttpRequest) JsonBody(obj interface{}) (*BeegoHttpRequest, error) {
259 if b.req.Body == nil && obj != nil { 264 if b.req.Body == nil && obj != nil {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!