(ctx context.Context, opts *rest.Opts, request any, response any)
| 640 | } |
| 641 | |
| 642 | func (c *pikpakClient) CallJSON(ctx context.Context, opts *rest.Opts, request any, response any) (resp *http.Response, err error) { |
| 643 | if c.captcha != nil { |
| 644 | token, err := c.captcha.Token(opts) |
| 645 | if err != nil || token == "" { |
| 646 | return nil, fserrors.FatalError(fmt.Errorf("couldn't get captcha token: %v", err)) |
| 647 | } |
| 648 | if opts.ExtraHeaders == nil { |
| 649 | opts.ExtraHeaders = make(map[string]string) |
| 650 | } |
| 651 | opts.ExtraHeaders["x-captcha-token"] = token |
| 652 | } |
| 653 | return c.client.CallJSON(ctx, opts, request, response) |
| 654 | } |
| 655 | |
| 656 | func (c *pikpakClient) Call(ctx context.Context, opts *rest.Opts) (resp *http.Response, err error) { |
| 657 | return c.client.Call(ctx, opts) |
no test coverage detected