Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

browser xhr doesn't allow for content type to be specified #180

Closed
IgorMinar opened this issue Dec 6, 2010 · 4 comments
Closed

browser xhr doesn't allow for content type to be specified #180

IgorMinar opened this issue Dec 6, 2010 · 4 comments

Comments

@IgorMinar
Copy link
Contributor

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

@vojtajina
Copy link
Contributor

This is actually not true - there are only default headers hard-coded. You can rewrite them per request.
https://github.com/angular/angular.js/blob/master/src/Browser.js#L91

The problem is, that $xhr doesn't allow to specify headers...
https://github.com/angular/angular.js/blob/master/src/service/xhr.js#L129

@alimills
Copy link

alimills commented Jun 4, 2011

For those looking to patch $xhr on their own, this simple update should let you specify headers: https://gist.github.com/1007646

@IgorMinar
Copy link
Contributor Author

as of 0.9.17 it is possible to change http header defaults, please check out http://docs.angularjs.org/#!/api/angular.service.$xhr

@IgorMinar
Copy link
Contributor Author

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.
Projects
None yet
Development

No branches or pull requests

3 participants