How to find the Status Code of a feign. Response when there is no server response

Asked

Viewed 20 times

0

If you use Postman to request a server, I always get Status Code. We will use this website as example for server. Where I put Status Code 599 as seen:

Servidor com Status Code 599

Now using the Postman:

Postman

How can I get this code 599 using Java 7/8 when I don’t get an answer on the body? I have a method of Coder like this:

public static String decoder(feign.Response httpResponse) { 
    String objJson = null;
    if(httpResponse.body().toString() != null) {
        objJson = httpResponse.body().toString();
    }
        
    return objJson ;
}

Any way to dynamically download this Status Code without doing multiple validations in a Try-catch block? What better way to implement?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.