question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: AngularJS $http API compatibility?

See original GitHub issue

For 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:closed
  • Created 8 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
petejohansoncommented, Jul 24, 2015

It is not only internal. See:

You can see this in the docs here: https://docs.angularjs.org/api/ng/service/$http under the Usage of $http(config) for transformRequest, transformResponse, and the return value.

Those are in fact the two cases where the API differs between $http and axios.

0reactions
patrickliechtycommented, Jul 18, 2016

I will look into moxios thanks. Ya I don’t think it has to work just the same as $http

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found