Question: AngularJS $http API compatibility?
See original GitHub issueFor my hy-res hypermedia client library, which also has a thin AngularJS wrapper angular-hy-res, most of the library expects an $http
-like API for making and consuming requests. For the most part, I can interchange axios (e.g. in my integration tests for the hy-res core library) and $http
in the angular-hy-res case without problem.
The only area where I have hit a true API incompatibility is with the handling of the headers
in either the resolved promises, or the parameters for things like transformRequest
. You can see an example here.
Question: Is axios’ goal to be as API compatible with $http
as possible? If so, would you consider changes to the headers
instances to match AngularJS?
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
AngularJS: Miscellaneous: FAQ
What is the version compatibility between AngularJS main and optional modules? AngularJS code is separated into a main module ("angular"), and a few...
Read more >AngularJS $http and $resource
$resource wraps $http for use in RESTful web API scenarios. Speaking VERY generally: A RESTful web service will be a service with one...
Read more >75 AngularJS Interview Questions and Answers (2022)
1) What is AngularJS? AngularJS is a javascript framework used for creating single web page applications. It allows you to use HTML as...
Read more >48 Top AngularJS Interview Questions and Answers [2022 ...
Q #31) What is a representational state transfer(REST) in AngularJs? Answer: REST is an API style that operates over the HTTP request. The ......
Read more >AngularJS Interview Questions and Answers
13) What browsers does AngularJS support? Ans: The latest version of AngularJS 1.3 support Safari, Chrome, Firefox, Opera 15+, IE9+ and mobile browsers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is not only internal. See:
headers
field of response promise.You can see this in the docs here: https://docs.angularjs.org/api/ng/service/$http under the Usage of
$http(config)
fortransformRequest
,transformResponse
, and the return value.Those are in fact the two cases where the API differs between
$http
and axios.I will look into moxios thanks. Ya I don’t think it has to work just the same as $http