My problem is that I want to use Java to implement an application which sends an HTTP GET request to some website. However, the target website needs one cookie to be set:
Country=US
If this cookie is null it returns bad indications. My question is how I can set the cookie value before I use openConnection()?
You can use
URLConnectionand add aCookieheader:http://www.hccp.org/java-net-cookie-how-to.html