Slide 158
Slide 158 text
ZupClientConfig config = ZupClientConfig.custom(
)
.withRequestTimeout(Duration.of(5, SECONDS)
)
.withRetryPolicy(RetryPolicy.custom(
)
.retryOn(HttpStatus5xxException.class
)
.withMaxAttempts(3
)
.withDelay(Duration.of(100, MILLIS), 2
)
.build()
)
.build();
ZupHttpClient client = new ZupHttpClient<>(config)
;
Frete frete = client.get(url
)
.withParameter("cep", cep
)
.execute();