开发者社区> 问答> 正文

oss上传400报错

leehor 2018-07-27 16:08:02 2646
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>


新手上路;看到报错懵了。求助大神们。谢谢了
XML 对象存储 数据格式
分享到
取消 提交回答
全部回答(1)
  • leehor
    2018-07-27 16:20:48
    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);
                            }
                        });
    0 0
+ 订阅

时时分享云计算技术内容,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

推荐文章
相似问题