HttpURLConnection based rest_v2 GET cookie based authentication erro
Posted on September 17, 2013 at 7:18am
I am using a HttpURLConnection (con) object and trying to do: con.setRequestProperty("Cookie", cookie); [Note: cookie is a plain string that I got from a different method written to return cookie in the prescribed format as a string like $Version=0; JSESSIONID=5598BB8D8B4F2F69A3D8AA16677EE534; $Path=/jasperserver-pro]
Constantly hitting 403 error :(
Any pointers will be really helpful.
Posted on September 18, 2013 at 5:12am
I was able to resolve the same. Problem : I was also trying to put the "Cookie: " in front of $Version, while trying to set the cookie via setRequestProperty
Posted on September 18, 2013 at 5:09am
Actually the jaspersessionid value should be set in the header of the request, not as a property. Also, I'm writting COOKIE instead of Cookie, and I don't use the $Version property, and I don't use the '$' character before the 'Path' property.