zoukankan      html  css  js  c++  java
  • ajax 提交数据

    在ajax post的方式的时候,如果后台出现该接到对象数据但是总接到字符串数据的时候
    type: 'POST',
    data: {'evaluator_id':reverseId,'evaluate_comment':content},
    contentType: "application/json",

    后面接的是一个string的数据
    Request Playload
    evaluator_id=ff808081631fb8b301631fc44a060041&evaluate_comment=12
    
    而 加上JSON.stringfy()后接到的数据就正常了
    type: 'POST',
     data: JSON.stringify({'evaluator_id':reverseId,'evaluate_comment':content}),
    contentType: "application/json",
    
    之后,后面就接到了对象模式的数据
    {evaluator_id: "ff808081631fb8b301631fc44a060041", evaluate_comment: "23"}
    evaluate_comment:"23"
    evaluator_id:"ff808081631fb8b301631fc44a060041"
  • 相关阅读:
    bzoj1098 1301
    bzoj3237
    bzoj3170
    bzoj4008
    一些题解
    bzoj4028
    bzoj3196
    redis学习
    quartz学习
    电商618 压测、优化、降级预案
  • 原文地址:https://www.cnblogs.com/xk-g/p/9264225.html
Copyright © 2011-2022 走看看