Changeset ff72ad2 for node_modules/axios/README.md
- Timestamp:
- 04/01/25 22:58:15 (2 months ago)
- Branches:
- master
- Children:
- 8ae59d6
- Parents:
- 3a74959
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
node_modules/axios/README.md
r3a74959 rff72ad2 4 4 </td><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we're Descope! We are building something in the authentication space for app developers and can’t wait to place it in your hands.">Hi, we're Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Documentation</b></a> | <a href="https://www.descope.com/community?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Community</b></a> </p> 5 5 </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buzzoid-buy-instagram-followers.png" alt="Buzzoid - Buy Instagram Followers"/> </a> <p align="center" title="At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world's #1 IG service since 2012.">At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rate...</p> <p align="center"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>buzzoid.com</b></a> </p> 6 </td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.com/ buy-tiktok-likes?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/famety-buy-instagram-followers.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the world’s #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.com/buy-tiktok-likes?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>www.famety.com</b></a> </p>6 </td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/famety-buy-instagram-followers.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the world’s #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.com/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>www.famety.com</b></a> </p> 7 7 </td><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/instagram-likes.png" alt="Poprey - Buy Instagram Likes"/> </a> <p align="center" title="Buy Instagram Likes">Buy Instagram Likes</p> <p align="center"> <a href="https://poprey.com/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>poprey.com</b></a> </p> 8 </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://musicza.co.za/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="124px" height="52px" src="https://axios-http.com/assets/sponsors/opencollective/musicza.png" alt="Tubidy"/> </a> <p align="center" title="Tubidy: Free Music and Video Downloads | MP3, MP4">Tubidy: Free Music and Video Downloads | MP3, MP4</p> <p align="center"> <a href="https://musicza.co.za/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>musicza.co.za</b></a> </p> 9 </td><td align="center" width="33.333333333333336%"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/youtube-subscribers-ssmarket.png" alt="Buy Youtube Subscribers"/> </a> <p align="center" title="SS Market offers professional social media services that rapidly increase your YouTube subscriber count, elevating your channel to a powerful position.">SS Market offers professional social media services that rapidly increase your YouTube subscriber co...</p> <p align="center"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>ssmarket.net</b></a> </p> 10 </td><td align="center" width="33.333333333333336%"> <a href="https://twicsy.com/buy-instagram-followers?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="85px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buy-instagram-followers-twicsy.png" alt="Buy Instagram Followers Twicsy"/> </a> <p align="center" title="Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site to buy followers from the likes of US Magazine.">Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site...</p> <p align="center"> <a href="https://twicsy.com/buy-instagram-followers?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>twicsy.com</b></a> </p> 8 11 </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a> 9 12 </td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a> … … 136 139 ``` 137 140 141 Using bun: 142 143 ```bash 144 $ bun add axios 145 ``` 146 138 147 Once the package is installed, you can import the library using `import` or `require` approach: 139 148 … … 158 167 ``` 159 168 160 For some bundlers and some ES6 linter 's you may need to do the following:169 For some bundlers and some ES6 linters you may need to do the following: 161 170 162 171 ```js … … 373 382 method: 'get', // default 374 383 375 // `baseURL` will be prepended to `url` unless `url` is absolute .384 // `baseURL` will be prepended to `url` unless `url` is absolute and option `allowAbsoluteUrls` is set to true. 376 385 // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs 377 386 // to methods of that instance. 378 387 baseURL: 'https://some-domain.com/api/', 388 389 // `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`. 390 // When set to true (default), absolute values for `url` will override `baseUrl`. 391 // When set to false, absolute values for `url` will always be prepended by `baseUrl`. 392 allowAbsoluteUrls: true, 379 393 380 394 // `transformRequest` allows changes to the request data before it is sent to the server … … 409 423 paramsSerializer: { 410 424 411 // Custom encoder function which sends key/value pairs in an iterative fashion.425 // Custom encoder function which sends key/value pairs in an iterative fashion. 412 426 encode?: (param: string): string => { /* Do custom operations here and return transformed string */ }, 413 427 … … 415 429 serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ), 416 430 417 // Configuration for formatting array indexes in the params.431 // Configuration for formatting array indexes in the params. 418 432 indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes). 419 433 }, … … 449 463 // Also, you can set the name of the built-in adapter, or provide an array with their names 450 464 // to choose the first available in the environment 451 adapter: 'xhr' // 'fetch' | 'http' | ['xhr', 'http', 'fetch']465 adapter: 'xhr', // 'fetch' | 'http' | ['xhr', 'http', 'fetch'] 452 466 453 467 // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. … … 529 543 socketPath: null, // default 530 544 531 // `transport` determines the transport method that will be used to make the request. If defined, it will be used. Otherwise, if `maxRedirects` is 0, the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, which can handle redirects. 545 // `transport` determines the transport method that will be used to make the request. 546 // If defined, it will be used. Otherwise, if `maxRedirects` is 0, 547 // the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. 548 // Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, 549 // which can handle redirects. 532 550 transport: undefined, // default 533 551 … … 691 709 ### Config order of precedence 692 710 693 Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults .js](https://github.com/axios/axios/blob/master/lib/defaults/index.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.711 Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults/index.js](https://github.com/axios/axios/blob/main/lib/defaults/index.js#L49), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. 694 712 695 713 ```js … … 713 731 714 732 ```js 733 734 const instance = axios.create(); 735 715 736 // Add a request interceptor 716 axios.interceptors.request.use(function (config) {737 instance.interceptors.request.use(function (config) { 717 738 // Do something before request is sent 718 739 return config; … … 723 744 724 745 // Add a response interceptor 725 axios.interceptors.response.use(function (response) {746 instance.interceptors.response.use(function (response) { 726 747 // Any status code that lie within the range of 2xx cause this function to trigger 727 748 // Do something with response data … … 737 758 738 759 ```js 739 const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); 760 const instance = axios.create(); 761 const myInterceptor = instance.interceptors.request.use(function () {/*...*/}); 740 762 axios.interceptors.request.eject(myInterceptor); 741 763 ``` … … 816 838 | status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. 817 839 818 Below is a list of potential axios identified error 840 Below is a list of potential axios identified error: 819 841 | Code | Definition | 820 842 | -------- | ---------- | … … 1127 1149 The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON. 1128 1150 1129 - `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects 1151 - `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects. 1130 1152 1131 1153 - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`)
Note:
See TracChangeset
for help on using the changeset viewer.