简体   繁体   中英

Process reponse data when getting a non HTTP 2xx answer with appAPI.request

I'm using appAPI.request to make ajax calls to an external web API. This works very well, but the API sends HTTP status codes other than 200 when something goes wrong. It also sends the error message/code when this happens. As the onFailure callback does only returns the http error code, but not the response message, i'm unable to read the error message sent by the server. Is there any way to retrieve the response message when onFailure gets called?

As of now, the HTTP response text is not currently available in the onFailure callback. However, as we are constantly working on improvements, we will add this to our API in future releases.

Disclaimer: I am a Crossrider employee

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM