MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / SendRequestWithCookie

Method SendRequestWithCookie

client/ticket.go:32–45  ·  view source on GitHub ↗
(request *http.Request)

Source from the content-addressed store, hash-verified

30)
31
32func (c *QQClient) SendRequestWithCookie(request *http.Request) (*http.Response, error) {
33 u, err := url.Parse(request.URL.String())
34 if err != nil {
35 return nil, err
36 }
37 cookies, err := c.GetCookies(u.Hostname())
38 if err != nil {
39 return nil, err
40 }
41 request.AddCookie(&http.Cookie{Name: "skey", Value: cookies.SKey})
42 request.AddCookie(&http.Cookie{Name: "p_uin", Value: strconv.Itoa(int(cookies.uin))})
43 request.AddCookie(&http.Cookie{Name: "p_skey", Value: cookies.PsKey})
44 return c.ticket.client.Do(request)
45}
46
47func (c *QQClient) GetSkey() (string, error) {
48 if time.Now().Before(c.ticket.sKey.expireTime) {

Callers 10

GetGroupAlbumMethod · 0.95
uploadGroupAlbumBlockMethod · 0.95
FetchEssenceMessageMethod · 0.95
GetGroupHonorInfoMethod · 0.95
GetGroupNoticeMethod · 0.95
uploadGroupNoticePicMethod · 0.95
AddGroupNoticeSimpleMethod · 0.95
AddGroupNoticeWithPicMethod · 0.95
DelGroupNoticeMethod · 0.95

Calls 2

GetCookiesMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected