Please find below the code I am using:
Http http = new Http();
HttpRequest request = new HttpRequest();
String url='http://abc:8090/part/abc/abc/';
request.setEndpoint(url);
request.setMethod('GET');
HttpResponse response = http.send(request);
System.debug('Response:'+response);
I am able to access the url in the browser and I have added the base url in the Remote site settings too. But the above code does not call the web service. The reponse I get is
Response:System.HttpResponse[Status=Service Unavailable, StatusCode=503]
And when I change the url to 'https://th-apex-http-callout.herokuapp.com/animals' It works perfectly well.
Could anyone please help me if there is anything wrong with the url?