Ticket Created
over 5 years ago

WERETECH-8758

Wrong response code when using makeImageRequest

Hi,

I'm using the makeImageRequest to request some image.

Sometimes, the server returns a 401 status code but the value of the response code in the callback is 404.

As long as there is this problem, I don't know how to differentiate errors.

Please note that in spite of a very close signature, there is no problem with the markeWebRequest method.

Best regards,

Parents
  • Thank you, with your answer, I have a better understanding of how it works. I had ideas for other tests. Until now, when the server return an error, the response was empty or json result. Now, I had make some tests returning a fake image with error status code. It seems that if the server return an image, the response code is 200 in the callback even if the status code of the server response is 4xx or 5xx. The response code of the callback directly depends on the result of the pre-processing and don't care about the response status code. If the body of the response is a valid image response code is 200, if the response is an invalid image, response code is 404 in the simulator (and 0 on my watch) regardless the value of the status code. Is there a chance that this problem will be corrected in a future release ?
Comment
  • Thank you, with your answer, I have a better understanding of how it works. I had ideas for other tests. Until now, when the server return an error, the response was empty or json result. Now, I had make some tests returning a fake image with error status code. It seems that if the server return an image, the response code is 200 in the callback even if the status code of the server response is 4xx or 5xx. The response code of the callback directly depends on the result of the pre-processing and don't care about the response status code. If the body of the response is a valid image response code is 200, if the response is an invalid image, response code is 404 in the simulator (and 0 on my watch) regardless the value of the status code. Is there a chance that this problem will be corrected in a future release ?
Children
No Data