Provide a way to send a JSON object with `WebClient`
See original GitHub issueJSON is the dominant exchange format for REST API.
However, Armeria’s WebClient does not provide any JSON-specific APIs.
I believe it should be useful additions if we provide:
WebClient client = WebClient.of();
// Send a serialized JSON object with "applicaiton/json"
HttpResponse response = client.postJson("/items", new MyItem());
HttpResponse response = client.putJson("/items", new MyItem());
HttpResponse response = client.patchJson("/items", new MyItem());
HttpResponse response = client.prepare()
.post("/items")
.contentJson(new MyItem())
.execute();
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to send request body in spring-boot web client?
The above answer is correct: Adding application/json in your Content-Type header solves the ...
Read more >Get List of JSON Objects with WebClient - Baeldung
In this article, we'll find out how to convert a JSON Array into a Java Array of Object, Array of POJO, and a...
Read more >How to Read JSON Data with Spring WebClient - amitph
In this tutorial, first, we will use WebClient to read a single JSON object and parse it into a POJO. Later, we will...
Read more >Sending HTTP requests with Spring WebClient - Reflectoring
How to Make a GET Request with WebClient · We create a WebClient instance · We define a request using the WebClient instance,...
Read more >Spring Boot - How to use WebClient - Home - Gustavo Peiretti
ClientResponse response = webClient.post() .uri("/accounts") .body ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m interested in this!
Additionally, how do you think similar feature,Additionally, how about addingHttpRequest.ofJson?HttpRequest.ofJsonalso?