Can anybody please, help me out in get/set cookie in http get request from a blackberry application ?
I was able to get the cookie by iterating through the response header. I don’t know whether this is the best practice to retrieve the cookie. Please advise.
Iterating through the headers is pretty much all you can do to read cookies from an Http response.
To set the cookie, you have to use the “Set-Cookie” header and have name=value defined for the Http requests. If you don’t know how to set headers for HttpRequests in Blackberry, you have to use the
setRequestPropertymethod for anHttpConnectionobject.Here, the method call would be something like this:
con.setRequestProperty ("Set-Cookie", "NAME=VALUE");