Created
November 28, 2018 19:44
-
-
Save samuelcatalano-zz/2a81e183e37474ab78502b6c1057a001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ObjectMapper mapper = new ObjectMapper(); | |
try { | |
usuario = mapper.writeValueAsString(usuarioRaichu); | |
final Client client = ClientBuilder.newClient(); | |
response = client | |
.target(host) | |
.request().header("Authorization", authToken) | |
.accept(MediaType.APPLICATION_JSON) | |
.post(Entity.entity(usuario, "application/json")); | |
} catch (final JsonProcessingException e) { | |
log.log(Level.SEVERE, "Erro ao criar usuário às {0} - {1}", | |
new Object[]{LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME), | |
e.getMessage()}); | |
throw new UserException("Erro ao criar usuário"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment