Commit 23457ed2 authored by astaxie's avatar astaxie

add sethost

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 {
return b return b
} }
// Set HOST
func (b *BeegoHttpRequest) SetHost(host string) *BeegoHttpRequest {
b.req.Host = host
return b
}
// 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 (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 {
return b return b
} }
// JsonBody adds request raw body encoding by JSON. // JsonBody adds request raw body encoding by JSON.
func (b *BeegoHttpRequest) JsonBody(obj interface{}) (*BeegoHttpRequest, error) { func (b *BeegoHttpRequest) JsonBody(obj interface{}) (*BeegoHttpRequest, error) {
if b.req.Body == nil && obj != nil { if b.req.Body == nil && obj != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment