Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observable.ajax throws exception when it receives HTTP 405 Method not allowed #1699

Closed
joehmchan opened this issue May 11, 2016 · 3 comments
Closed

Comments

@joehmchan
Copy link

RxJS version: 5.0.0-beta.6
Code to reproduce:
Observable.ajax.getJSON('https://freegeoip.net/json/')

Expected behavior:
If the api doesn't support HTTP OPTIONS, it should proceed to HTTP GET instead of throwing exception.

Actual behavior:
The freegeoip returns HTTP Error 405 Method not allowed. An exception is thrown from the Observable.

@benlesh
Copy link
Member

benlesh commented Feb 21, 2017

Sorry for the incredibly late response. By definition, any 400 status is an error.

What's interesting here, is a basic XHR send seems to work, there's something about that getJSON call that is causing the pre-flight request and error. I'll either need to bone-up on my XHR voodoo again, or refer to someone else.

@benlesh
Copy link
Member

benlesh commented Feb 21, 2017

@jeffbcross or @robwormald ... maybe you have some insights here, since you worked on something similar for Angular?

@benlesh
Copy link
Member

benlesh commented Aug 18, 2020

This is expected behavior with our implementation. Responses with error codes are treated as errors.

@benlesh benlesh closed this as completed Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants