java - Why is my QueryParam returning null -
disclaimer : not j2ee developer. code works elsewhere, 1 api going crazy.
code
@get     @path("getcloseby")     @consumes({ mediatype.text_plain })     @produces({ mediatype.application_json })     public cservicecenters getlist(@queryparam("latitude") double latitude,             @queryparam("longitude") double longitude) {             log.info("getcloseby searching lat "                     + latitude + " lng " + longitude);   getcloseby searching lat 17.63 lng null
calling client
curl http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9
disclaimer: not big curl user, don't know nuances, , why works. may shell problem.
to work had add quotes " around url
curl "http://:8080/mywar/myapi/getcloseby?latitude=17.63&longitude=73.9"
note: tried escape & (without quotes) urisyntaxexeption server.
Comments
Post a Comment