text: (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{170:function(a,t,r){"use strict";r.r(t);var e=r(0),i=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,r=a._self._c||t;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"介绍"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[a._v("#")]),a._v(" 介绍")]),a._v(" "),r("h2",{attrs:{id:"特性"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#特性","aria-hidden":"true"}},[a._v("#")]),a._v(" 特性")]),a._v(" "),r("ul",[r("li",[a._v("移植优秀的@angular/common/http模块。")]),a._v(" "),r("li",[a._v("兼容非angular项目")]),a._v(" "),r("li",[a._v("基于rxjs的响应式请求库。")]),a._v(" "),r("li",[a._v("使用 TypeScript 构建，提供完整的类型定义文件。")]),a._v(" "),r("li",[a._v("功能强大又简单易用。")]),a._v(" "),r("li",[a._v("\b可自定义多个请求响应的拦截器")])]),a._v(" "),r("h2",{attrs:{id:"为什么不是"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#为什么不是","aria-hidden":"true"}},[a._v("#")]),a._v(" 为什么不是...?")]),a._v(" "),r("h3",{attrs:{id:"fetch"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#fetch","aria-hidden":"true"}},[a._v("#")]),a._v(" fetch")]),a._v(" "),r("ul",[r("li",[a._v("fetch浏览器原生内置API")]),a._v(" "),r("li",[a._v("优点：免引入第三方依赖，基于Promise")]),a._v(" "),r("li",[a._v("缺点：API过于简单，没有提供拦截器功能，需要手动序列化和反序列化，一般需要经过封装后才可以使用，兼容性问题")])]),a._v(" "),r("h3",{attrs:{id:"axios"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#axios","aria-hidden":"true"}},[a._v("#")]),a._v(" axios")]),a._v(" "),r("ul",[r("li",[a._v("目前最流行的ajax请求库之一")]),a._v(" "),r("li",[a._v("优点：\b可自定义的配置多，提供拦截器，兼容性好，体积小，基于Promise")]),a._v(" "),r("li",[a._v("缺点：cancel的API比较难用，无法应对复杂的请求场景，不支持jsonp")])]),a._v(" "),r("h3",{attrs:{id:"jquery"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#jquery","aria-hidden":"true"}},[a._v("#")]),a._v(" JQuery")]),a._v(" "),r("ul",[r("li",[a._v("老牌的前端类库")]),a._v(" "),r("li",[a._v("优点：兼容性好")]),a._v(" "),r("li",[a._v("缺点：体积大，没有提供拦截器功能，请求配置优点复杂")])])])}],!1,null,null,null);i.options.__file="README.md";t.default=i.exports}}]);