2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

docs: refresh CDN URLs and example JSON headers (#7236)

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
techcodie
2025-12-30 17:00:43 +05:30
committed by GitHub
parent 46db3316ac
commit f8694341de
6 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -189,13 +189,13 @@ const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundl
Using jsDelivr CDN (ES5 UMD browser module):
```html
<script src="https://cdn.jsdelivr.net/npm/axios@1.6.7/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios@1.13.2/dist/axios.min.js"></script>
```
Using unpkg CDN:
```html
<script src="https://unpkg.com/axios@1.6.7/dist/axios.min.js"></script>
<script src="https://unpkg.com/axios@1.13.2/dist/axios.min.js"></script>
```
## Example
+1 -1
View File
@@ -27,7 +27,7 @@ const people = [
export default function (req, res) {
res.writeHead(200, {
'Content-Type': 'text/json'
'Content-Type': 'application/json'
});
res.write(JSON.stringify(people));
res.end();
+1 -1
View File
@@ -8,7 +8,7 @@ export default function (req, res) {
req.on('end', function () {
console.log('POST data received');
res.writeHead(200, {
'Content-Type': 'text/json'
'Content-Type': 'application/json'
});
res.write(JSON.stringify(data));
res.end();
+1 -1
View File
@@ -6,7 +6,7 @@ export default function (req, res) {
req.on('end', function () {
console.log('POST received');
res.writeHead(200, {
'Content-Type': 'text/json'
'Content-Type': 'application/json'
});
res.end();
});
+1 -1
View File
@@ -21,7 +21,7 @@ const composeSignals = (signals, timeout) => {
let timer = timeout && setTimeout(() => {
timer = null;
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT))
}, timeout)
const unsubscribe = () => {
+1 -1
View File
@@ -32,7 +32,7 @@ describe('helpers::composeSignals', () => {
signal.addEventListener('abort', resolve);
});
assert.match(String(signal.reason), /timeout 100 of ms exceeded/);
assert.match(String(signal.reason), /timeout of 100ms exceeded/);
});
it('should return undefined if signals and timeout are not provided', async () => {