45 lines
908 B
Go
45 lines
908 B
Go
package requests
|
|
|
|
import (
|
|
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
|
"io"
|
|
"strings"
|
|
)
|
|
|
|
type HttpRequest struct {
|
|
*baseRequest
|
|
}
|
|
|
|
func (request *HttpRequest) init() {
|
|
request.baseRequest = defaultBaseRequest()
|
|
request.Method = POST
|
|
}
|
|
|
|
func (request *HttpRequest) BuildUrl() string {
|
|
return ""
|
|
}
|
|
|
|
func (request *HttpRequest) BuildQueries() string {
|
|
return ""
|
|
}
|
|
|
|
func (request *HttpRequest) GetActionName() string {
|
|
return request.actionName
|
|
}
|
|
|
|
func (request *HttpRequest) InitWithApiInfo(product, version, action string) {
|
|
request.init()
|
|
request.product = product
|
|
request.version = version
|
|
request.actionName = action
|
|
}
|
|
|
|
func (request *HttpRequest) GetBodyReader() io.Reader {
|
|
if request.FormParams != nil && len(request.FormParams) > 0 {
|
|
formString := utils.GetUrlFormedMap(request.FormParams)
|
|
return strings.NewReader(formString)
|
|
} else {
|
|
return strings.NewReader("")
|
|
}
|
|
}
|