add sethost
Showing
1 changed file
with
6 additions
and
1 deletions
| ... | @@ -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 { | ... | ... |
-
Please register or sign in to post a comment