angular $http配置属性

$http请求的配置对象

$http()接受的配置对象可以包含以下属性:

method:http请求方式,可以为GET,DELETE,HEAD,JSONP,POST,PUT

url:字符串,请求的目标

params:字符串或者对象,会被转换成为查询字符串追加的url后面

data:在发送post请求时使用,作为消息体发送到服务器

headers:一个列表,每个元素都是一个函数,返回http头

xsrfHeaderName(字符串):保存XSFR令牌的http头的名称

xsrfCookieName:保存XSFR令牌的cookie名称

transformRequest:函数或者函数数组,用来对http请求的请求体和头信息进行转换,并返回转换后的结果。

transformResponse:函数或者函数数组,用来对http响应的响应体和头信息进行转换,并返回转换后的结果。

cache:布尔类型或者缓存对象,设置之后angular会缓存get请求。

timeout:数值,延迟请求

responseType:字符串,响应类型。可以为arraybuffer, blob,document,json, text, moz-blob, moz-chunked-text, moz-chunked-arraybuffer

$http请求的响应对象

angular传递给then方法的响应对象包括以下几个属性

data:转换之后的响应体

status:http响应状态码

headers:头信息

config:生成原始请求的设置对象

statusText:http响应状态的文本

时间: 2024-08-08 06:03:28

angular $http配置属性的相关文章

Hibernate 中配置属性详解(hibernate.properties)

Hibernate能在各种不同环境下工作而设计的, 因此存在着大量的配置参数.多数配置参数都 有比较直观的默认值, 并有随 Hibernate一同分发的配置样例hibernate.properties 来展示各种配置选项. 所需做的仅仅是将这个样例文件复制到类路径 (classpath)下并做一些自定义的修改. 属性1.Hibernate JDBC属性 属性名 用途 hibernate.connection.driver_class jdbc驱动类 hibernate.connection.ur

Dotcms中文教程之一:管理(1.2、修改DotCMS配置属性)

修改DotCMS配置属性 DotCMS配置文件dotmarketing-config.properties在以下文件夹中可以找到: /dotserver/tomcat-X.x/webapps/ROOT/WEB-INF/classes/ 这个文件必须在插件中重写,以防止破坏这些变化在接下来dotCMS升级中. 在静态配置插件中修改配置属性,使用以下步骤: 1.从dotmarketing-config属性文件复制你想改变属性. 2.在你的dotCMS安装目录plugins/com.dotcms.co

spring 配置属性细节

苹果的WWDC ,除了发布了os x 10.10 和IOS8 外,还推出了Swift.详细点击这里 代码总体风格有点像Java,也有点像javascript. 下面给出一些代码段(来自苹果官方手册): println("Hello, world") "var myVariable = 42 myVariable = 50 let myConstant = 42" 摘录来自: Apple Inc. "The Swift Programming Languag

5 -- Hibernate的基本用法 --4 9 其他常用的配置属性

Hibernate其他常用的配置属性: ⊙ hibernate.show_sql : 是否在控制台输出Hibernate持久化操作底层所使用的SQL语句.只能为true和false两个值. ⊙ hibernate.format_sql : 是否将SQL语句转成格式良好的SQL.只接受true和false两个值. ⊙ hibernate.use_sql_comments : 是否在Hibernate生成的SQL语句中添加有助于调试的注释.只接受true和false值. ⊙ hibernate.jd

solr的schema.xml配置属性解释

schema.xml做什么? SOLR加载数据,创建索引和数据时,核心数据结构的配置文件是schema.xml,该配置文件主要用于配置数据源,字段类型定义,搜索类型定义等.schema.xml的配置直接影响搜索结果的准确性与效率. <types></types>节点 types节点主要用于搜索类型的定义,这里给出常用类型的定义. 1 <fieldType name="string" class="solr.StrField" sortM

7.maven配置文件中&lt;scope&gt;的6种配置属性解释(源自官方文档) -- 依赖的范围

7.maven配置文件中<scope>的6中配置属性解释 说明:我们知道在pom.xml中<scope>标签是设置依赖作用域的,那么具体的设置类型有哪几种,分别作用的什么时候呢? Dependency Scope Dependency scope is used to limit the transitivity of a dependency, and also to affect the classpath used for various build tasks. There

Spring boot将配置属性注入到bean类中

一.@ConfigurationProperties注解的使用 看配置文件,我的是yaml格式的配置: // file application.yml my: servers: - dev.bar.com - foo.bar.com - jiaobuchong.com 1 2 3 4 5 6 下面我要将上面的配置属性注入到一个Java Bean类中,看码: import org.springframework.boot.context.properties.ConfigurationProper

smvc配置属性编辑器:

1 配置属性编辑器: 2 在springmvc.xml中配置: 3 4 <!-- 注解驱动 --> 5 <mvc:annotation-driven conversion-service="conversionService"> 6 7 </mvc:annotation-driven> 8 9 <!-- 自定义注册属性编辑器 --> 10 <bean id="conversionService" 11 class

jqGrid配置属性说明

Property Type Description Default1) ajaxGridOptions object This option allows to set global ajax settings for the grid when requesting data. Note that with this option it is possible to overwrite all current ajax settings in the grid including the er

Spring中配置属性文件

Spring中配置和读取Properties文件 public class PropertiesFactoryBeanextends PropertiesLoaderSupportimplements FactoryBean, InitializingBean Allows for making a properties file from a classpath location available as Properties instance in a bean factory. Can b