go sdk 上传填写callback的参数报错

生成token代码如下:

putPolicy := rs.PutPolicy{
        Scope: bucketName,
        CallbackUrl:  `xxx.com:3163/callback`,
        **CallbackBody: `key=<key>&hash=$<etag>`,**
//       ReturnUrl:    `www.baidu.com`,
//       ReturnBody:   `{"key": $(key), "hash": $(etag), "w": $(imageInfo.width), "h": $(imageInfo.height)}`,
        // AsyncOps:     asyncOps,
        // EndUser:      endUser,
         Expires:      TOKEN_EXPIRATION_SECOND,
         SaveKey:       key,
    }

请问我callbackbody那格式是那样吗?

根据token来上传文件的代码:

    var ret io.PutRet
    **m := make(map[string]string)
    m["key"] = "$(key)"
    m["hash"] = "$(etag)"**
    var extra = &io.PutExtra{
        //请求:
        **Params: m,**
        // MimeType: mieType,
        // Crc32:    crc32,
        // CheckCrc: CheckCrc,
    }

这样的写法错了吗?我看官方文档都过时了,上传报错:

{
    "error": "{\"callback_url\":\"test-upload.airdroid.com:3163/callback\",\"callback_bodyType\":\"application/x-www-form-urlencoded\",\"callback_body\":\"{\\\"key\\\": liuli_1406259126762475553, \\\"hash\\\": lrA11fwnmPChYQ7yvPszVq9VWzA1, \\\"w\\\": 4928, \\\"h\\\": 3264}\",\"token\":\"QBox fpWzUFhgkUGVEph0rXeBVu6Y4hfMhuZ5qXqHYjJi:5Ex8hKsZR_gWHm641sZ01KP5DQw=\",\"err_code\":0,\"error\":\"Post test-upload.airdroid.com:3163/callback: unsupported protocol scheme\\\"test-upload.airdroid.com\\\"\"}",
    "reqid": "kS0AAORcW3I9CYQT",
    "details": [
        "rbd.w:72;rbd.r:5;sbd.r:81;sbd.s:12;sbd.c:14;sbd.w:3;SBD:113;sbd.r:67;sbd.s:13;sbd.c:11;sbd.w:3;SBD:97;RBD:115;rbd.w:5;rbd.r;sbd.r:8;sbd.s:1;sbd.c:12;sbd.w;SBD:22;sbd.r:5;sbd.s:1;sbd.c:17;sbd.w;SBD:25;RBD:26;RocksDBD/404;RocksDBG/404;v4.exist:2;rs6_2.ins;qtbl.ins:2;mc.s;RS:4;rs.put:11;rs-upload.putFile:173;UP.CB:0;up:/upload callback failed;UP:334/579"
    ],
    "code": 579
}

求解答~~~~~~~~~~~谢谢!

查看回复