HomeGuidesChangelogDiscussions
Log In
Discussions

Discussions

Ask a Question
ANSWERED

Undocumented error

So am trying to register users under an integrator and its gives a 404 error on unexpected moments, am sure the url and request method is correct. am using spring boot webclient, this is the code that makes the request.
private final WebClient client = WebClient.create("
https://sandbox.spendjuice.com");
public Mono registerCardUser(String integratorId, CardUserRegistrationDTO registrationDTO, String token) {
return client.method(HttpMethod.POST)
.uri("/card-integrators/{integratorId}/register-user", integratorId)
.header("Authorization", "Bearer " + token)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.body(Mono.just(registrationDTO), CardUserRegistrationDTO.class)
.exchangeToMono(clientResponse -> {
if (!clientResponse.statusCode().is2xxSuccessful()) {
clientResponse.body((clientHttpResponse, context) -> clientHttpResponse.getBody());
}
return clientResponse.bodyToMono(Object.class);
})
.log("uri");
}