Disclaimer : I am not a J2EE developer. But this code works elsewhere, but this one api is 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 for lat "
+ latitude + " lng " + longitude);
GetCloseby searching for lat 17.63 lng null
Calling from client
curl http://:8080/MYWAR/MYAPI/GetCloseby?latitude=17.63&longitude=73.9
Disclaimer: I am not a big cURL user, so I don't know all the nuances, and why this works. It may be a shell problem.
To get it work I had to add quotes " around the url
curl "http://:8080/MYWAR/MYAPI/GetCloseby?latitude=17.63&longitude=73.9"
Note: I also tried to escape the & (without the quotes) but I would get a URISyntaxExeption with the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With