oss上传400报错-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

oss上传400报错

E/RawMessage: <?xml version="1.0" encoding="UTF-8"?>
    <Error>
      <Code>InvalidArgument</Code>
      <Message>The callback var is not expecten json.</Message>
      <RequestId>5B5ACF9D77491D46B1953C59</RequestId>
      <HostId>leehor.oss-cn-shenzhen.aliyuncs.com</HostId>
      <ArgumentName>callback-var</ArgumentName>
      <ArgumentValue>{"x:answer":"否","x:pictureCount":"7","x:projectId":"16e76fd63c9b4e6a8cfa870801e8d8bb","x:stage":"1","x:number":"2","x:audio":null,"x:audioCount":"0","x:description":null,"x:answerId":"01d748207c9a43aa94175dac958c0633"}</ArgumentValue>
    </Error>


新手上路;看到报错懵了。求助大神们。谢谢了

展开
收起
leehor 2018-07-27 16:08:02 6329 0
1 条回答
写回答
取消 提交回答
  • leehor
    Reoss上传400报错
    回调部分代码
    格式有问题吗


    put.setCallbackParam(new HashMap<String, String>() {
                            {
                                Log.e("回调", "上传回调: " + Config.callbackAddress);
                                put("callbackUrl","http://survey.three3.cn:8081/three_research/app/answer/oss/callback.htm");
                                //callbackBody可以自定义传入的信息
                                put("callbackHost", "oss-cn-shenzhen.aliyuncs.com");
                                put("callbackBodyType", "application/json");
                                put("callbackBody","{\"projectId\":${x:projectId},\"answerId\":${x:answerId},\"description\":${x:description},\"answer\":${x:answer},\"pictureCount\":${x:pictureCount},\"audioCount\":${x:audioCount},\"number\":${x:number},\"stage\":${x:stage},\"audio\":${x:audio}}");
                            }
                        });
                        put.setCallbackVars(new HashMap<String, String>(){
                            {
                                put("x:projectId",projectsDB.getPid());
                                put("x:answerId",subjectsDB.getHt_id());
                                put("x:answer",answer);
                                put("x:description",explain);
                                put("x:pictureCount",String.valueOf(imageSize));
                                put("x:audioCount",String.valueOf(recorderSize));
                                put("x:number",String.valueOf(number));
                                put("x:stage",stage);
                                put("x:audio",audioFileName);
                            }
                        });
    2018-07-27 16:20:48
    赞同 展开评论 打赏
问答排行榜
最热
最新
相关电子书
更多
百问百答-OSS (上)
立即下载
百问百答-OSS (下)
立即下载
阿里云 JindoFS+OSS 数据上云实战
立即下载