> For the complete documentation index, see [llms.txt](https://xiaoxiami.gitbook.io/angularjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xiaoxiami.gitbook.io/angularjs/xhr/http.md).

# $http

* $http 是一个服务，简单的封装了XMLHttpRequest对象
* $http(config).success(fun).error(fun)

## $http短名方法

* $http.get()
* $http.delete()
* $http.header()
* $http.jsonp()
* $http.post()
* $http.put()

## $http 配置对象

* method
* url
* params&#x20;
* data
* headers
* xsrfHeaderName
* xsrfCookieName
* transformRequest
* transformResponse
* cache
* withCredentials
* timeout
* responseType

## responseType

* " (string – default)
* "arraybuffer" (ArrayBuffer)
* "blob" (blob object)
* "document" (HTTP document)
* "json" (JSON object parsed from a JSON string)
* "text" (string)
* "moz-blob" (Firefox to receive progress events)
* "moz-chunked-text" (streaming text)
* "moz-chunked-arraybuffer" (streaming ArrayBuffer&#x20;
