_axios的response.send是什么意思">
赞
踩
使用axios发送AJAX请求
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script crossorigin="anonymous" src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script> <title>Document</title> </head> <body> <button>GET</button> <button>POSY</button> <button>AJAX</button> <script> const btns = document.querySelectorAll('button'); axios.defaults.baseURL = 'http://127.0.0.1:8000'; btns[0].onclick = function(){ //GET请求 axios.get('/axios-server',{ //url参数 params:{ id:100, vip:7 }, //请求头信息 headers:{ name:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。