MCPcopy
hub / github.com/rclone/rclone / CallJSON

Method CallJSON

backend/pikpak/helper.go:642–654  ·  view source on GitHub ↗
(ctx context.Context, opts *rest.Opts, request any, response any)

Source from the content-addressed store, hash-verified

640}
641
642func (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
656func (c *pikpakClient) Call(ctx context.Context, opts *rest.Opts) (resp *http.Response, err error) {
657 return c.client.Call(ctx, opts)

Callers 15

readMetaDataForPathMethod · 0.45
AboutMethod · 0.45
setCustomPropertyMethod · 0.45
OpenMethod · 0.45
uploadMethod · 0.45
authenticateMethod · 0.45
getUsedSizeMethod · 0.45
renewUploadSessionMethod · 0.45
uploadUncheckedMethod · 0.45
RmdirMethod · 0.45
DirMoveMethod · 0.45
updateFilePropertiesMethod · 0.45

Calls 3

FatalErrorFunction · 0.92
TokenMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected