Reputation: 35
I have a Rest Service accepting QueryParam and the value has & in it and how do i pass it and accept it as a Query Param.
Here i am attaching the source i used. i am calling the same by
http://localhost:7001/Rest/GetInfo?type=J&Y
as & is the seperator its taking only till J.
if i use "\" then its not working.
http://localhost:7001/Rest/GetInfo?type=J\&Y
I am deploying on Weblogic.
@GET
@Path("/GetInfo")
//@Produces("text/javascript")
@Produces("application/json")
public String getInfo(@QueryParam("type") String type)
{
// i am reading the type here
if(type != null
getUserType(type)
}
Upvotes: 1
Views: 366
Reputation: 1188
You need to encode your url like:
http://localhost:7001/Rest/GetInfo?type=J%26Y
Upvotes: 1