Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionSession ¶
type ConnectionSession struct { Session *http.Client // 执行http请求 User string // 用于身份验证的用户名 Pass string // 用于身份验证的密码 Url string // 请求的url }
ConnectionSession 与服务器的连接回话
func NewConnectionSession ¶
func NewConnectionSession(user, pass, url string) *ConnectionSession
NewConnectionSession 创建一个新的连接会话 如果已经存在连接会话,则返回现有的连接会话,如果没有则创建一个新的连接会话
func (*ConnectionSession) HttpGetRequest ¶
func (c *ConnectionSession) HttpGetRequest(requestUrl string, headers map[string]string, params map[string]interface{}) (string, error)
HttpGetRequest 发起一个http的Get请求,并返回响应主题作为字符串 requestUrl: 请求链接 headers: 请求头 params: 请求参数
Click to show internal directories.
Click to hide internal directories.