This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
browser xhr doesn't allow for content type to be specified #180
Labels
Milestone
Comments
This is actually not true - there are only default headers hard-coded. You can rewrite them per request. The problem is, that $xhr doesn't allow to specify headers... |
For those looking to patch $xhr on their own, this simple update should let you specify headers: https://gist.github.com/1007646 |
as of 0.9.17 it is possible to change http header defaults, please check out http://docs.angularjs.org/#!/api/angular.service.$xhr |
I should add that we do plan to make it possible to specify headers on per-request basis as well, but allowing the defaults to be configured was the first step |
vojtajina
added a commit
to vojtajina/angular.js
that referenced
this issue
Aug 12, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions accepts parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
vojtajina
added a commit
to vojtajina/angular.js
that referenced
this issue
Aug 23, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() - setting timeout Breaks renaming $xhr to $http Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions accepts parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
vojtajina
added a commit
to vojtajina/angular.js
that referenced
this issue
Sep 2, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() - setting timeout Breaks renaming $xhr to $http Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions accepts parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
IgorMinar
pushed a commit
to IgorMinar/angular.js
that referenced
this issue
Oct 21, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() - setting timeout Breaks renaming $xhr to $http Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions accepts parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
vojtajina
added a commit
to vojtajina/angular.js
that referenced
this issue
Oct 27, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() - setting timeout Breaks renaming $xhr to $http Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions accepts parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
vojtajina
added a commit
to vojtajina/angular.js
that referenced
this issue
Nov 21, 2011
Features: - aborting requests - more flexible callbacks (per status code) - custom request headers (per request) - access to response headers - custom transform functions (both request, response) - caching - shortcut methods (get, head, post, put, delete, patch, jsonp) - exposing pendingCount() - setting timeout Breaks Renaming $xhr to $http Breaks Takes one parameter now - configuration object Breaks $xhr.cache removed - use configuration cache: true instead Breaks $xhr.error, $xhr.bulk removed Breaks Callback functions get parameters: response, status, headers Closes angular#38 Closes angular#80 Closes angular#180 Closes angular#299 Closes angular#342 Closes angular#395 Closes angular#413 Closes angular#414 Closes angular#507
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
we hardcode
application/x-www-form-urlencoded
in Browser.js and don't allow this to be changed.See: http://groups.google.com/group/angular/browse_thread/thread/6832936f1631d8d5
The text was updated successfully, but these errors were encountered: