I am using URLConnection to simulate a browser HTTP POST. However, the website (ebay) claims I cannot accept cookies? I have tried setting the "User-Agent", "Referer" fields etc...What am I doing wrong? How do I accept cookies? A code sample would be much appreciated.
To be able to support cookies, you get the "Set-Cookie" header, parse the data, store the cookie, and then send the cookies back properly.
Cookies are sent back using "Cookie" header. Cookies should be sent back to the server that set them at every request until the cookie expires.