Bankelaal Bankelaal - 4 months ago 40
reST (reStructuredText) Question

How to pass JSON as a query parameter in a HTTP request?

I am using RESTEasy stack to implement a REST based client and server. I have a service which handles

request, like below:

public String testPost(@QueryParam("thing") String thing) {

When I call from Postman or REST client the following URI:


I always get the error as Illegal character in query at index (pointing to =)

What is the reason for this?


If you're trying to parse a POST request, you should use @FormParam instead of @QueryParam. Then, you can make the post request doing something like this (using curl)

curl -i -X POST -H "Content-Type: application/json" -d thing="{\"id\":\"abc\"}" http://ip:port/base/this