Solve the HttpRequest interceptor to get inputStream multiple times

Write custom directory title here need plan custom annotation post interface Writing Aspects Customize a Wrapper define a filter write a configuration class Requirements Implement external interface access for signature verification Plan 1. Customize an annotation class 2. Define a POST request interface and mark it with annotations 3. Customize a facet and a filter […]

In-depth analysis of XMLHttpRequest: a powerful tool for asynchronous communication

Article directory introduce What is XMLHttpRequest? Basic usage of XMLHttpRequest 1. Create an XMLHttpRequest object 2. Configuration request 3. Send request XMLHttpRequest Attribute send readyState status statusText response responseText responseType responseURL timeout with Credentials Asynchronous and synchronous requests Request Types and Data Transfers Debug example code in conclusion Introduction In web application development, the XMLHttpRequest […]

Object AJAX – XMLHttpRequest object

The cornerstone of AJAX is the XMLHttpRequest object. 1. Create an XMLHttpRequest object 2. Define the callback function 3. Open the XMLHttpRequest object 4. Send a request to the server All modern browsers support the XMLHttpRequest object. The XMLHttpRequest object can be used to exchange data with a web server behind the scenes. This means […]

Full set of front-end asynchronous programming: xmlhttprequest > ajax > promise > async/await

Asynchronous programming The difference between synchronous and asynchronous Synchronization: Execute sequentially, send requests to the server –> the client does other operations Asynchronous: Execute separately, send a request to the server ==> perform other operations at the same time Native xmlhttprequest four steps create ajax object var a=new xmlhttprequest(); Set the data transmission method (get, […]

AJAX principle (XMLHttpRequest+Promise+URLSearchParams)

1. XMLHttpRequest The XMLHttpRequest (XHR) object is used to interact with the server. Through XMLHttpRequest, a specific URL can be requested to obtain data without refreshing the page. This allows the web page to update partial content of the page without affecting the user’s operation. XMLHttpRequest is heavily used in AJAX programming. Relationship: Axios internally […]

Django/HttpRequest/HttpResponse–Cookie/Session

1. HttpRequest object Several ways to use the HTTP protocol to pass parameters: Extract a specific part of the URL, such as /weather/beijing/2018, which can be intercepted with regular expressions in the server-side routing; Query string (query string), in the form of key1=value1 & amp;key2=value2; The data sent in the request body, such as form […]

Asynchronous request-XMLHttpRequest, ajax, axios principle analysis

Asynchronous request-XMLHttpRequest, ajax, axios principle analysis XMLHTTPRequest refer to readyState responseType XMLHttpRequest Level 1 XMLHttpRequest Level 2 polling Regular polling long polling Ajax refer to Imitate ajax package xmlHttpRequest axios refer to What are the features of axios? implement axios XMLHTTPRequest Reference XML and Ajax readyState value status description 0 UNSENT (unopened) Indicates that the […]

Front-end cross-domain mainstream solution (Access to XMLHttpRequest at ‘http..’ from origin ‘null’ has been blocked by CORS policy)

Question background The front-end and back-end are developed separately. Due to the same-origin policy of the browser itself (the server does not have this restriction), cross-domain will occur when the front-end accesses the server-side interface. Classic error: Access to XMLHttpRequest at ‘http…’ from origin ‘null’ has been blocked by CORS policy Solution: Note: There are […]

Use XMLHttpRequest to read and manipulate svg graphs in vue (control dom flickering)

<template> <div class=”this_bk”> <div id=”svgTemplate” ref=”svg”></div> </div> </template> <script> import wftSvg from “@/assets/svg/xxmap.svg”; export default { data() { return { svgDom: null, allDom: null, } }, created() { this. getSvg(); }, mounted() { // svg mouse scroll event window[‘havcZooming’] = (e) => { console.log(e, ‘havcZooming—–>>>’) this. zoomimg(); } }, methods: { getSvg() { let _this […]