java - Url encoding issue with Jersey Client -
i need make service call such this: http://myservice.com/path?var1=value1&var2=value2
the issue have value1 , value2 ends getting encoded, , makes service call fail. example, value1 "a=b&b=c;2&&="... contains special characters, basically.
i guessing issue service fix - handle decoding encoded characters, not think doing.
here sample of how making these requests:
webtarget target = client.target("http://test.com") .path("path1") .queryparam("var1", var1); builder builder = target.request(); ...
what's puzzling me if make same request using chrome, works. makes me believe should have way jersey api of "disabling" encoding.
only way have found far use "raw" url use uri. call this
uri uri = uri.create("http://localhost/~common~0#/edit?vadf&&sfs&&fdsfd=fs&fsd"); webtarget target = client.target(uri);
you request url
1 > http://localhost/~common~0#/edit?vadf&&sfs&&fdsfd=fs&fsd
everything else tried resulted in encoding special characters.
Comments
Post a Comment