Your code makes an HTTP request and does not work. For the error message, the URL is null , and the status code is 0 . 0 not the actual HTTP status code, but this may indicate that a timeout has occurred. This question is "Stack Overflow" and the answer contains some indications of what 0 might mean.
I came across this when testing a component. Mocking the HTTP request solved the problem. For what I recommend this mindram article on testing HTTP services .
source share