示例#1
0
// buildCommonRequestProps is an internal method to set common properties of requests that will send to OpsGenie.
func (cli *OpsGenieClient) buildCommonRequestProps() goreq.Request {
	if cli.httpTransportSettings == nil {
		cli.makeHTTPTransportSettings()
	}
	goreq.SetConnectTimeout(cli.httpTransportSettings.ConnectionTimeout)
	req := goreq.Request{}
	if cli.proxy != nil {
		req.Proxy = cli.proxy.toString()
	}
	req.UserAgent = userAgentParam.ToString()
	req.Timeout = cli.httpTransportSettings.RequestTimeout
	req.Insecure = true

	return req
}