Click here to Skip to main content
15,559,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
As you can see, in my service layer this method send post request like client to the server using Spring Boot WebClient framework, but I have getting a problem, which as you can see my method accept 4 params, which you see and I want to send these only 3 params to the server. I wonder how to set multiple params to send using WebClient? What method support this?

Java
@Override
public Mono<ResponseEntity<? extends ResponseResource>> sendSms(String message, List<BulkSmsRequestResource> request, String originatorName, String sendSmsApi) {
    if (request == null) {
        return Mono.just(new ResponseEntity<>(
                new ErrorResponseResource(
                        "Transaction failed successfully!",
                        400),
                HttpStatus.BAD_REQUEST));
    }
    Mono<BulkSmsRequestResource> bulkSmsRequestResourceMono = webClientBuilder.build()
            .post()
            .uri(sendSmsApi)
            .body(Mono.just(request), BulkSmsRequestResource.class)
            .retrieve()
            .bodyToMono(BulkSmsRequestResource.class);
    bulkSmsRequestResourceMono.subscribe();
    return Mono.just((new ResponseEntity<>(new SuccessResponseResource("Transaction done successfully", 200), HttpStatus.OK)));
}


What I have tried:

I tried to send in bulk using the Collection library, but I couldn't.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900