CURL -X POST http://localhost:8600/a/b/c -d '{"assignmentId[]":[12345]}'
I got this error:
"A servlet request, to the URI http://localhost:8600/a/b/c, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected."
When I changed my request to
CURL -X POST http://localhost:8600/a/b/c -H "Content-Type: application/json" -d '{"assignmentId[]":[12345]}'
(adding the header) the service was able to parse the request and handle it normally.
HTH,
kewpiedoll99
1 comment:
Also you might need to format the data passed like this:
$ curl -X POST -d 'barcode=12345678&locationString=xx-xx-013-x&status=MISRACKED&createdAt=2017-07-24T12:45:00' localhost:8080/cycleScan/1/anomaly
See this SO answer: https://stackoverflow.com/a/26968995/187423
Post a Comment