0

I want to create a "mock" server using Ratpack/Groovy and we need to read the data-raw from a call

I haven't had a problem reading headers or parameters, but I need to read the body of a request

Examplle:

curl --location --POST request 'http://localhost:5050/authenticate' \
--header 'Content-type: application/json' \
--raw-data '{
  "username": "testbase01@domain.com",
  "password": "12345678"
}'

we need to parse and process the username and password fields

We have tried to read the request.body, or the body.text, but we have not been successful.

Basically the example found in the solution at https://stackoverflow.com/questions/23636248/parse-json-in-ratpack-groovy would be what we need, but it hasn't worked for us either

Our environment has the following dependencies

If you have a small example, to be able to adapt it to our needs

0 Answers0