From 23457ed2a03a27b4be642dfc828fa6972ff5a98c Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 8 Apr 2015 20:12:10 +0800 Subject: [PATCH] add sethost --- httplib/httplib.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/httplib/httplib.go b/httplib/httplib.go index bd8bc776..bdd2d65a 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -184,6 +184,12 @@ func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest { return b } +// Set HOST +func (b *BeegoHttpRequest) SetHost(host string) *BeegoHttpRequest { + b.req.Host = host + return b +} + // Set the protocol version for incoming requests. // Client requests always use HTTP/1.1. func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest { @@ -253,7 +259,6 @@ func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest { return b } - // JsonBody adds request raw body encoding by JSON. func (b *BeegoHttpRequest) JsonBody(obj interface{}) (*BeegoHttpRequest, error) { if b.req.Body == nil && obj != nil {