zoukankan      html  css  js  c++  java
  • Postman中x-www-form-urlencoded请求K-V的ajax实现

    在Postman中使用x-www-form-urlencoded,并且用K-V传值,但是在代码中用ajax来请求,传值一直有问题,静下心来思考才发现K-V传入的是string,所以记录下来以防忘记!!!

    在Ajax中需要将Value中的json转换为string:

    let robotAuditStr = {"orderId":"","auditor":"","status":0, "type":2,"note":"test"};
    $.ajax({
        url: `http://cloud.qiyi.domain/apis/audit/robotAudit`,
        type: "POST",
        contentType: "application/x-www-form-urlencoded",
        data: {robotAuditStr: JSON.stringify(robotAuditStr)}
    })
  • 相关阅读:
    异步编程
    MVC返回文件
    MVC源码分析
    MVC源码分析
    MVC源码分析
    MVC源码分析
    MVC源码分析
    MVC源码分析
    MVC源码分析
    MVC源码分析
  • 原文地址:https://www.cnblogs.com/jayinnn/p/10417012.html
Copyright © 2011-2022 走看看