- get:$http.get ( url ,config ).
- post: $http.post (url , data , config ).
- put: $http.put ( url , data ,config ).
- delete: $http.delete ( url , config ).
head: http.head.另外: http.jsonp ( url ,config ) 触发jsonp请求.
- url :调用的目标url
- data:请求中的送出的数据
- config:包含额外信息的javascript配置对象,对请求和响应都有影响
配置对象说明: - method:所用的http方法
- url :请求的目标url
- params:url的参数
- headers:额外的请求头
- timeout:xhr请求终止前的超时时间(单位是毫秒)。
- cache:xhr get请求的缓存开关
- transformresquest,transformresponse:在与后端交换数据前或交换后,对数据进行处理的数据交换函
xhr请求方式
最新推荐文章于 2024-10-21 06:06:42 发布