Ajax

Ajax Learning Log (5) – How to pass json format request parameters

Getting Started with Ajax (5) 1. How to pass json format request parameters1.1) The Content-Type of json format is: application/json1.2) Use the use method in app.js and create a route1.3) Create a new html file in the public folder1.4) Run in browser 1. How to pass json format request parameters 1.1) The Content-Type of json format is: application/json xhr.setRequestHeader('Content-Type', 'applic... »

gateway solves cross-domain problems, and has been solved by personal testing

Cross domain: If the domain name or port is different, it means cross-domainOverview of cross-domain issues: The browser prohibits the sender of the request from making cross-domain ajax requests with the server, so the request is intercepted by the browser.solution: Ajax solves cross-domain problems through cros, that is, before each request, it will ask the target server whether it allows its ow... »

Ajax Advanced Chapter 02—Cross-domain and JSONP

PrefaceNo matter how bumpy the road ahead is, as long as you go in the right direction, you are closer to happiness than standing still. Ajax Advanced Chapter 02—Cross-domain and JSONP 1. Ajax Advanced Chapter 02—Cross-domain and JSONP(1) Same origin strategy1.1 What is homology1.2 What is the same-origin policy? (2) Cross-domain2.1 What is cross-domain2.2 Browser interception of cross... »

Encapsulate http requests based on uview

1. Create a new config folder under the project 2.request.js file content // This vm parameter is an instance of the page, through which you can reference variables in vuex module.exports = (vm) => {//Initialize request configuration     uni.$u.http.setConfig((config) => {/* config is the default global configuration */config.baseURL = ”; /* Root domain name */         config.timeout =... »

Introduction to asynchronous request ajax, native ajax, basic use of $.ajax

In this article, we will learn how ajax works and have used native ajax and jquery‘s ajax for programming exercises. Table of contents Introduction to ajax principles what is ajax Advantages of ajax Ajax application scenarios Ajax principle analysis use ajax native ajax jquery uses ajax $.ajax() $.get() $.post() Summarize Introduction to ajax principles Ajax is now an important tool for fron... »

Accept this Mock and quickly coordinate with the backend to improve efficiency by more than 100 million points.

Table of contents Preface text 1. Introduction to Mock 1. Principle of Mock 2、Mock.mock() 3. Mock syntax specifications 4、Mock.setup() 5. More methods 2. Use of Mock 1. Installation 2. Create 3. Use 3. Precautions Summarize Preface In the daily development process, an essential stage is to conduct joint debugging with the backend, and use the data returned by the backend to view the page rendering... »

Summary of Ajax principles

oneAjaxTechnology and Principles AJAX = Asynchronous JavaScript and XML(Asynchronous JavaScript and XML). AJAX is a technology for exchanging data with a server and updating parts of a web page without reloading the entire page. The core of AJAX is the XMLHttpRequest object. How Ajax works The working principle of Ajax is equivalent to adding an intermediate layer (AJAX engine) between the user an... »

Global configuration and custom configuration axios instance of axios in vue

Global configuration and custom configuration axios instance of axios in vue Preface1. Install relevant plug-in modulesInstall axios:Install qs:Install element: 2. Global configuration of axios1. Create files2. Import configuration file3. Write configuration files 3. Create and configure axios instance1. Create files3. Write axios instance configuration file4. Use the created axios instanceStep 1:... »

POST request

Uplink messages are information HTTP requests are in pairs, and if there is a request, there will be a response. Called “upstream request” and “downstream response”. No matter what kind of request it is, data will be transmitted in the form of “header” + “message” Generally, the uplink message of the uplink request is empty, and the downlink message ... »

axios.post sends a request, and axios sends a post request, carrying parameters and passing them to the interface.

When using axios in vue to send a post request, you need to use the qs module to serialize the parameters and send them to the backend. Otherwise, the interface will not receive the parameters. import qs from “qs” Remember to install it npm i qs -S The first var url = "Replace with your address"; var data = {} axios({ url, data: qs.stringify(data), method: 'post', headers: { 'Content-T... »

Page 1 of 15123»