search

Home  >  Q&A  >  body text

angular.js - Do the $http method and $httpProvider in angularjs have the same meaning?

Do the $http method and $httpProvider in angularjs have the same meaning?
When I read a book, it was said that $http method is used to interact with the server, but $httpProvider is used. Is this a concept?

天蓬老师天蓬老师2819 days ago566

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-05-15 17:05:46

    Use $httpProvider to change the default behavior of the $http service.

    $httpProvider is used to set the configuration of $http requests, such as disabling cache globally, adding headers, etc.

    https://docs.angularjs.org/api/ng/provider/$httpProvider

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:05:46

    Configure $http, that is, you need to use $httpProvider in the config function

    reply
    0
  • Cancelreply