$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响应状态的文本

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

  1. 【配置属性】—Entity Framework 对应表字段的类型的设定配置方法

    摘自:http://www.cnblogs.com/nianming/archive/2012/11/07/2757997.html Entity Framework Code First的默认行为是 ...

  2. spring配置属性的两种方式

    spring配置属性有两种方式,第一种方式通过context命名空间中的property-placeholder标签 <context:property-placeholder location ...

  3. android 自定义控件 使用declare-styleable进行配置属性(源码角度)

          android自定义styleableattrs源码 最近在模仿今日头条,发现它的很多属性都是通过自定义控件并设定相关的配置属性进行配置,于是便查询了解了下declare-styleabl ...

  4. hibernate学习笔记--可选的配置属性

    3.4.  可选的配置属性 有大量属性能用来控制Hibernate在运行期的行为. 它们都是可选的, 并拥有适当的默认值. 警告: 其中一些属性是"系统级(system-level)的&qu ...

  5. SpringBoot配置属性之Server

    SpringBoot配置属性系列 SpringBoot配置属性之MVC SpringBoot配置属性之Server SpringBoot配置属性之DataSource SpringBoot配置属性之N ...

  6. 【转】android 自定义控件 使用declare-styleable进行配置属性(源码角度)

    原文网址:http://blog.csdn.net/vipzjyno1/article/details/23696537 最近在模仿今日头条,发现它的很多属性都是通过自定义控件并设定相关的配置属性进行 ...

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

    一.@ConfigurationProperties注解的使用 看配置文件,我的是yaml格式的配置: // file application.yml my: servers: - dev.bar.c ...

  8. Hibernate配置属性

    Hibernate配置属性 属性名 用途 hibernate.dialect 一个Hibernate Dialect类名允许Hibernate针对特定的关系数据库生成优化的SQL. 取值 full.c ...

  9. hadoop之 hadoop 2.2.X 弃用的配置属性名称及其替换名称对照表

    Deprecated Properties  弃用属性 The following table lists the configuration property names that are depr ...

  10. webpack2的配置属性说明entry,output,state,plugins,node,module,context

    Webpack2配置属性详解 webpack说明 webpack是前端构建的一个核心所在,如果说后端构建就是把高级语言代码编译成机器码,那么前端的构建就是重新组合原有的代码,虽然并不编译成机器码,但实 ...

随机推荐

  1. 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved

    "This file could not be checked in because the original version of the file on the server was m ...

  2. Sharepoint学习笔记—习题系列--70-576习题解析 -(Q21-Q24)

    Question 21 An application will be deployed in a SharePoint 2010 server farm that is managed by depa ...

  3. iOS 三方库fmdb 的使用

    使用fmdb 做本地数据的存储非常方便, 1. github 上搜索fmdb 下载压缩包 导入到工程中 (如果你的mac 有cocoapod 也可以直接通过cocoapod 添加) 2. 以下代码是通 ...

  4. Ubuntu16.04 LTS 下安装 Android Studio 2.2.2 步骤

    下载 Android SDK,官网:www.android.com 我相信很多人跟我一样,进不去.Android Studio 中文官网 www.android-studio.org 进去下载, 在终 ...

  5. linux pstack命令总结

    pstack命令用来显示进程的栈跟踪. pstack 命令必须由相应进程的属主或root账号运行.可以使用pstack来确定进程挂起的位置.此命令只有一个参数,那就是pid,具体关于pstack的介绍 ...

  6. javascript多态 - 类形式实现demo

    /* *多态 * 对传入的参数做判断以实现多种调用方式 */ //类形式实现 function Add(){ function zero(){ return 10; } function one(nu ...

  7. IIS安装和使用(Windows Server 2003)

    1.安装IIS ①将系统盘插入光驱 ②进入:控制面板--添加/删除Windows组件--选择“应用程序服务器”--点击“详细信息” ③选择:ASP.NET和Internet信息服务(IIS),点击“确 ...

  8. 关于InnoDB的Next-Key lock

    最近一段时间在准备新员工培训的材料,本来打算介绍介绍概念就OK的,但是既然写了事务的章节,就特别想介绍一下锁,介绍了锁,就忍不住想介绍一下Next-Key Lock. 大家知道,标准的事务隔离级别有R ...

  9. 中科院分词ICTCLAS5.0_JNI 使用方法

    1.简介 中国科学院计算技术研究所在多年研究基础上,耗时一年研制出了基于多层隐码模型的汉语词法分析系统 ICTCLAS(Institute of Computing Technology, Chine ...

  10. TCP连接建立系列 — 服务端接收ACK段(一)

      http://blog.csdn.net/zhangskd/article/details/17923917 分类: Linux TCP/IP Linux Kernel 2014-01-07 09 ...