<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>HTTP on Text Matrix</title><link>https://0f9f3b1c.text-matrix.pages.dev/tags/http/</link><description>Recent content in HTTP on Text Matrix</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 08 Apr 2026 11:10:11 +0800</lastBuildDate><atom:link href="https://0f9f3b1c.text-matrix.pages.dev/tags/http/index.xml" rel="self" type="application/rss+xml"/><item><title>Axios：Promise HTTP 客户端完全指南</title><link>https://0f9f3b1c.text-matrix.pages.dev/posts/tech/axios-promise-http-client-guide/</link><pubDate>Fri, 03 Apr 2026 01:25:00 +0800</pubDate><guid>https://0f9f3b1c.text-matrix.pages.dev/posts/tech/axios-promise-http-client-guide/</guid><description>&lt;h1 id="axiospromise-http-客户端完全指南">Axios：Promise HTTP 客户端完全指南&lt;/h1>
&lt;h2 id="学习目标">学习目标&lt;/h2>
&lt;p>学完本指南后，你将掌握以下核心技能：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>理解 Axios 的核心概念&lt;/strong>：理解什么是 Promise-based HTTP 客户端、为什么选择 Axios、以及它与 fetch API 的区别&lt;/li>
&lt;li>&lt;strong>掌握 Axios 的安装和配置&lt;/strong>：能够根据不同环境（浏览器、Node.js）选择合适的安装方式，并完成基础配置&lt;/li>
&lt;li>&lt;strong>熟练使用 Axios 发送各类请求&lt;/strong>：掌握 GET、POST、PUT、PATCH、DELETE 等请求方法，以及如何传递参数和请求体&lt;/li>
&lt;li>&lt;strong>理解和使用拦截器&lt;/strong>：掌握请求拦截器和响应拦截器的使用场景和用法&lt;/li>
&lt;li>&lt;strong>处理错误和超时&lt;/strong>：理解 Axios 的错误处理机制，能够正确处理网络错误和超时情况&lt;/li>
&lt;li>&lt;strong>掌握取消请求的方法&lt;/strong>：理解 AbortController 和 CancelToken 的用法&lt;/li>
&lt;li>&lt;strong>理解请求配置选项&lt;/strong>：掌握常用的请求配置项，理解配置优先级的规则&lt;/li>
&lt;li>&lt;strong>二次开发和扩展&lt;/strong>：能够创建 Axios 实例、编写自定义适配器、实现请求限流等功能&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="一项目概述">一、项目概述&lt;/h2>
&lt;h3 id="11-axios-是什么">1.1 Axios 是什么&lt;/h3>
&lt;p>&lt;strong>Axios&lt;/strong> 是一个基于 Promise 的 HTTP 客户端，用于浏览器和 Node.js 环境。它提供了简洁易用的 API，能够轻松发送异步 HTTP 请求。&lt;/p></description></item></channel></rss>