I did not have a look at your code, but in cases of “Network Request Failed”, I usually run the exact same request using Postman or something similar just to make sure that the error is part of the app and not on the server.
This looks like the function didn’t even perform the request at all, if it did, it should have returned even the Response Code as a hint.
I am not sure about your specific problem but here are my suggestions as to what you can do.
I think this has something to do with CORS error because your making an app connect to a localhost which has many security barriers.
You could try exposing your local angular app by using ngrok. The command usually goes like this ngrok http 8080. The ngrok endpoint you get, you can use to replace your url with something more accessible. Visit ngrok here: https://ngrok.com/
If your going to send a JSON data, might as well change your accept and content-type to application/json since you already expect a json value.
Authorization usually follows this pattern
Basic YWxhZGRpbjpvcGVuc2VzYW1l
It’s available here: Authorization - HTTP | MDN
I noticed your authorization does not include a space between Basic and the credential (the space between is important).
It looks like the request is unauthorized so you need to have a look at the token and make sure it is valid. Also, make sure you are sending all the required headers.