zoukankan      html  css  js  c++  java
  • jQuery ajax请求 一般请求和自定义请求

     
    //一般post请求
           $.ajax({
                    type:"POST",
                    url:url,
                    async:false,
                    data:Data,
                    dataType:'json',
                    success:function(data){
                         console.log(data);
                    }
                });
    //特定请求头的请求    application/json
     
        
                 url = "http://*************:8080/biz-services/sdk/qryGroups/offline"
                Data = {pageCategoryType:pageCategoryType,pageId:pageId,day:day},
                $.ajax({
                type:"POST",
                url:url,
                // async:false,
                contentType: 'application/json;charset=UTF-8',
                headers: {
                     'Accept': 'application/json',
                     'Content-Type': 'application/json'
                },
                dataType:'json',
                data: JSON.stringify(Data),//对请求参数进行json转化
                success:function(data){
                    console.log(data.datas);
                    if(data.result == 1){
                        return
                    }
                }
            });
  • 相关阅读:
    Vue
    linux-----docker
    linux基础
    Flask基础
    websocket
    css
    Mysql数据库基础
    IO多路复用
    线程和协程
    sh_02_del关键字
  • 原文地址:https://www.cnblogs.com/hanlengyao/p/10150007.html
Copyright © 2011-2022 走看看