$http
リクエストヘッダーフィールドを特定の1つのリクエスト(これは$httpProvider
レベルではないことを意味します)から削除します。これらのフィールドは次のとおりです。
- のCache-Control
- 場合修飾-ので
- リファラー
- X-要求-で
単一の要求でこれを行うには? transformRequest
パラメータを使用しようとしましたが、動作させるのに十分な情報が見つかりませんでした。このような[CoffeeScriptの]コード:
$scope.logout = ->
$http({
method: 'GET'
url: '/api/logout'
headers: { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' }
transformRequest: (data, headersGetter) ->
console.log data
console.log headersGetter
data
}).success ->
$location.path('editor')
はheadersGetterは(絶対に何も私に言っている)function (c){a||(a=Nb(b));return c?a[y(c)]||null:a}
である、と私はtransformRequest関数から返すために何を理解していなかった、data
がundefined
であることを示しています。