mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 00:50:51 +00:00
add sethost
This commit is contained in:
parent
466f3c49c1
commit
642a69de02
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user