JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

前端请求报错:'JSON parse error: syntax error, expect {, actual e…1, line 1, column 2selectUid%5B%5D=VluJeA9upFXgJD', code: '500'}

发布时间 2023-07-24 19:03:54作者: 信铁寒胜
1、如果不用
JSON.stringify(inputJson) 包起来就会报错
let inputJson = {"selectUid" : selectUid};
    var response = await $.ajax({
        type: 'POST',
        url: 'xxx',
        data: inputJson,  //正确的是JSON.stringify(inputJson)
        contentType: "application/json;charset=UTF-8",
        dataType: "json",
    })

  

    本栏目推荐文章
  • 跟着阿灵学前端(1)——HTML 基础
  • 跟着阿灵学前端(2)——CSS 基础
  • A connection was successfully established with the server but then an error
  • vscode错误:Unable to connect to VS Code server: Error in request.
  • 【解决方案】Error running,Command line is too long
  • 【五期李伟平】CCF-A(AAAI'21)Game of Gradients: Mitigating Irrelevant Clients in Federated Learning
  • 2024-01-13 Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. ==》引用了未使用的方法导致
  • Python中出现"No module named 'requests'"的图文解决办法
  • fish和pacman:“error: Unable to read input file: 是一个目录”报错的处理
  • ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password'
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们