aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/http.js
AgeCommit message (Collapse)Author
2013-09-30docs($http): update grammar in commentsMartin Cortez
Closes #4186
2013-09-25docs($http): fix adding default header to get request exampleMr.Raindrop
Initially, `$httpProvider.defaults.headers.get` is `undefined`, so `$httpProvider.defaults.headers.get['My-Header']='value'` will throw an error. Closes #4101
2013-09-13docs($http): add examples when calling $http outside $applyPete Bacon Darwin
Closes #3996
2013-09-13docs($http): explain why $http may not make the request immediatelyDang Nguyen Anh Khoa
I came across this issue today and after researching has found out this thread on so: http://stackoverflow.com/questions/17039998/angular-not-making-http-requests-immediately. It took me quite sometimes to figure out this so I hope the addition in documentation could save somebody else some times and frustration.
2013-09-02fix($http): allow empty responses to be cachedjankuca
Closes #3809
2013-08-27style($http): remove unused argumentIgor Minar
2013-08-14docs($http): added return to interceptors success callbackMikk Kirstein
2013-07-27docs(*): fixed typos and ngdoc parameter namesCarl Danley
2013-07-19fix(core): parse URLs using the browser's DOM APIChirayu Krishnappa
2013-07-12fix($http): allow interceptors to completely override headersIgor Minar
Closes #2770
2013-07-08feat($http): accept function as headers valuebolasblack
So we can request with dynamic header value. module.factory('Res', [ '$resource' '$routeParams' 'globalConfig' function($resource, $routeParams, globalConfig) { resource('/url/:id', {id: "@id"}, { patch: { method: 'patch', headers: { 'Authorization': function() { return "token " + globalConfig.token; } } } }); }]);
2013-06-19fix($http): ensure case-insens. header overridingCaio Cunha
If user send content-type header, both content-type and default Content-Type headers were sent. Now default header overriding is case-insensitive.
2013-05-20feat($http): add support for aborting via timeout promisesDavid Bennett
If the timeout argument is a promise, abort the request when it is resolved. Implemented by adding support to $httpBackend service and $httpBackend mock service. This api can also be used to explicitly abort requests while keeping the communication between the deffered and promise unidirectional. Closes #1159
2013-05-16feat($http): add a default content type for PATH requestsDaniel Stockton
The default header is now application/json which while not perfect in all cases is better than the browser default application/xml. The new headers also makes for better compatibility with Rails 4
2013-05-09style(*): fix up semicolon and var usageAnatoly Shikolay
2013-04-15fix($location): fix URL interception in hash-bang modeMisko Hevery
Closes #1051
2013-04-11docs(http): spelling, grammar, capitalization, etc.Artur Ostrega
2013-04-11docs($http): fix a typoChad Whitacre
2013-03-29docs(*): fixed typosPascal Borreli
2013-03-27feat(http): support request/response promise chainingSylvester Keil
myApp.factory('myAroundInterceptor', function($rootScope, $timeout) { return function(configPromise, responsePromise) { return { request: configPromise.then(function(config) { return config }); response: responsePromise.then(function(response) { return 'ha!'; } }); } myApp.config(function($httpProvider){ $httpProvider.aroundInterceptors.push('myAroundInterceptor'); });
2013-03-08feat(http): set custom default cache in $http.defaults.cacheAlexander Shtuchkin
When we need more control over http caching, we may want to provide a custom cache to be used in all http requests by default. To skip default cache, set {cache: false} in request configuration. To use other cache, set {cache: cache} as before. See #2079
2013-03-06docs($http): add more info about transform functionIgor Minar
2013-02-14fix($http): do not encode special characters `@$:,` in paramsVojta Jina
encodeURIComponent is too aggressive and doesn't follow http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path segments so we need this test to make sure that we don't over-encode the params and break stuff like buzz api which uses @self. This is has already been fixed in `$resource`. This commit fixes it in a same way for `$http` as well. BREAKING CHANGE: $http does follow RFC3986 and does not encode special characters like `$@,:` in params. If your application needs to encode these characters, encode them manually, before sending the request.
2013-02-07feat($http): allow overriding the XSRF header and cookie nameSam McCall
Add 'xsrfCookieName' and 'xsrfHeaderName' property to $httpProvider.defaults and http config object, which give the name of the cookie the XSRF token is found in, and the name of the header it is sent in, respectively. This allows interop with servers with built-in XSRF support that use different names. The defaults match the current hard-coded values of 'XSRF-TOKEN' and 'X-XSRF-TOKEN'.
2013-01-03docs($http): clarify documentation on error status codesPer RovegÄrd
Modify the documentation for $http to correspond to what Angular considers a success status code. Closes #1693
2012-12-06docs($http): fix link typo in $http docJeremy Tymes
Should be $httpBackend instead of $httpBacked Closes #1516
2012-11-26fix($http): only set X-XSFR-TOKEN header for same-domain requestRado Kirov
This is needed to prevent CORS preflight checks. The XSFR token is quite useless for CORS requests anyway. BREAKING CHANGE: X-XSFR-TOKEN is no longer send for cross domain requests. This shouldn't affect any known production service. Closes #1096
2012-11-26fix($http): remove 'X-Requested-With' from header defaultsRado Kirov
X-Requested-With header is rarely used in practice and by using it all the time we are triggering preflight checks for crossdomain requests. We could try detecting if we are doing CORS requests or not, but it doesn't look like it's worth the trouble. BREAKING CHANGE: X-Requested-With header is not set by $http service any more. If anyone actually uses this header it's quite easy to add it back via: ``` myAppModule.config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest'; }]); ``` Closes #1004
2012-11-24fix($http): config.param should expand array values properlyTom Davis
Today, calling e.g. $http(url, { params: { a: [1,2,3] } }) results in a query string like "?a=%5B1%2C2%2C3%5D" which is undesirable. This commit enhances buildURL to createa query string like "?a=1&a=2&a=3". BREAKING CHANGE: if the server relied on the buggy behavior then either the backend should be fixed or a simple serialization of the array should be done on the client before calling the $http service. Closes #1363
2012-09-11feat($http): Allow setting withCredentials on defaultsTom Hughes
Closes #1095.
2012-08-10feat($http): support reponseTypeVojta Jina
Closes #1013
2012-06-12docs(*): simplify doc urlsIgor Minar
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
2012-06-08fix($http): add utf-8 to default Content-Type header (post/put)Vojta Jina
This fixes special characters issue with MongoLab. https://groups.google.com/d/topic/angular/1T6h7bfZ7Rs/discussion
2012-05-04chore(docs): re-skin main documentationMisko Hevery
2012-04-11docs($http): fix return typesIgor Minar
2012-04-11feat($http): expose the defaults config as $http.defaultsIgor Minar
Often it is impossible to set the http defaults during the config phase, because the config info is not available at this time. A good example is authentication - often the app needs to bootstrap, allow user to enter credentials and only then it gains access to session token which then should be sent to the server with every request. Without having the ability to set the defaults at runtime, the developer either has to resort to hacks, or has to set the session token header with every request made by the app.
2012-04-04feat($http): add withCredentials config optionVojta Jina
2012-03-28feat($http): make the transform defaults to an arrayIgor Minar
$httpProvider.defaults.transformRequest and $httpProvider.defaults.transformResponse are now arrays containing single function. This makes it easy to add an extra transform fn. adding an extra fn before had to be done in this cluncky way: $httpProvider.defaults.transformResponse = [$httpProvider.defaults.transformResponse, myTransformFn]; after this change, it's simply: $httpProvider.defaults.transformResponse.push(myTransformFn);
2012-03-28style($http): remove redundant 'use strict' headerIgor Minar
2012-03-28chore(Rakefile): get ready for modulesMisko Hevery
2012-03-28chore(module): move files around in preparation for more modulesMisko Hevery