ajax使用API的方式访问,一直报错400,请求包参数对比没问题,哪里有问题?

  • 回答 (0)
  • 关注 (1)
  • 查看 (312)

jquery.min.js:4 POST http://recognition.image.myqcloud.com/face/livegetfour 400 (Bad Request)

请求代码如下:

$.ajax({

type : "POST",

dataType : "JSON",

url : "http://recognition.image.myqcloud.com/face/livegetfour",

beforeSend:function(xhr) {

//Host

xhr.setRequestHeader('Content-Type','multipart/form-data');

xhr.setRequestHeader('Authorization',"dasjkldjslafjlajafla====");

},

// headers:{'host':"recognition.image.myqcloud.com"},

data :{

"appid":"125710346311",

"image":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAAEAYABgAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMQD/2wCEAAgGBgcGBQgHBwcKCQgKDRYODQwMDRsTFBAWIBwiIR8cHx4jKDMrIyYwJh4fLD0tMDU2OTo5Iis/Qz44QzM4OTcBCQoKDQsNGg4OGjckHyQ3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//EAaIAAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKCwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eo",

'seq':""

},

用户2627089用户2627089提问于

所属标签

可能回答问题的人

  • zqfan

    腾讯 · 高级工程师 (已认证)

    29 粉丝0 提问236 回答
  • 用户1220546

    0 粉丝1 提问1 回答
  • 御姐万岁

    6 粉丝508 提问1 回答

扫码关注云+社区

领取腾讯云代金券