File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,21 @@ function $HttpProvider() {
349
349
* In addition, you can supply a `headers` property in the config object passed when
350
350
* calling `$http(config)`, which overrides the defaults without changing them globally.
351
351
*
352
+ * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,
353
+ * Use the `headers` property, setting the desired header to `undefined`. For example:
354
+ *
355
+ * ```
356
+ * var req = {
357
+ * method: 'POST',
358
+ * url: 'http://example.com',
359
+ * headers: {
360
+ * 'Content-Type': undefined
361
+ * },
362
+ * data: { test: 'test' },
363
+ * }
364
+ *
365
+ * $http(req).success(function(){...}).error(function(){...});
366
+ * ```
352
367
*
353
368
* ## Transforming Requests and Responses
354
369
*
You can’t perform that action at this time.
0 commit comments