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

Return the appropriate status code from XHR #169

Merged
merged 1 commit into from
Mar 19, 2015
Merged

Return the appropriate status code from XHR #169

merged 1 commit into from
Mar 19, 2015

Conversation

andrewimm
Copy link
Contributor

Some libraries use the HTTP status code to interact with APIs. Rather than hardcoding the response code to 200, this sets the server-reported status code as the status property of an XHR instance.

@tadeuzagallo
Copy link
Contributor

Could you also replace the error response with the actual status instead of the hardcoded @0?

@andrewimm
Copy link
Contributor Author

In case of an error, would the client even receive a status code? I was under the impression that an error object is only passed in the case of a network navigation error. In my experiments, 4xx and 5xx server errors were still passed to the JS side with my changes.

@tadeuzagallo
Copy link
Contributor

Oops, sorry about that, totally makes sense, the connection was ok, the response just wasn't 200.

tadeuzagallo added a commit that referenced this pull request Mar 19, 2015
Return the appropriate status code from XHR
@tadeuzagallo tadeuzagallo merged commit c656cd9 into facebook:master Mar 19, 2015
@vjeux
Copy link
Contributor

vjeux commented Mar 19, 2015

@tadeuzagallo: unfortunately you can't merge code like this. You need to use the internal tool to submit an internal diff. Otherwise this is going to be erased next time we sync

vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 13, 2015
Summary:
Manually import pull request facebook#169 from github
https://github.com/facebook/react-native/pull/169/files

Test Plan: Just do a XMLHttpRequest
harrykiselev pushed a commit to harrykiselev/react-native that referenced this pull request Aug 5, 2015
- Fix formatting of numbered list (replaces facebook#169)
- Remove unused "development process" section
ayushjainrksh referenced this pull request in MLH-Fellowship/react-native Jul 2, 2020
* Include a native module preparation guide with code scaffolding tool so that readers can jump straight into the code

* Update native-modules-setup.md
react-one pushed a commit to react-one/react-native that referenced this pull request Sep 24, 2021
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

Successfully merging this pull request may close these issues.

3 participants