Skip to content

Instantly share code, notes, and snippets.

@donchan922
Created June 27, 2020 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/1669693ff74b16cd23354f2a1ea74dd2 to your computer and use it in GitHub Desktop.
Save donchan922/1669693ff74b16cd23354f2a1ea74dd2 to your computer and use it in GitHub Desktop.
try {
Response response = restTemplate.getForObject("http://localhost:8080/error", Response.class);
} catch(RestClientResponseException exception) {
exception.getRawStatusCode(); // HTTPステータスコード
exception.getResponseHeaders(); // レスポンスヘッダ
exception.getResponseBodyAsString(); // レスポンスボディ
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment