Re: Webrequest + Cookies...
Code:
Dim Cookies As New CookieContainer
Cookies.Add(New Cookie("testcookie", "testvalue"))
Dim request As HttpWebRequest = CType(WebRequest.Create("http://www.google.fi/"), HttpWebRequest)
request.CookieContainer = Cookies
Re: Webrequest + Cookies...
ok, i got the dim cookies as cookiecontainer part.
wouldnt the cookies.add come from the website itself?
Re: Webrequest + Cookies...
Nope. If you're using webrequests you need to do everything yourself that a browser would normally do. In this case you need to parse the cookies from the response you get, add them into your cookies, and when requesting again set your request.CookieContainer = cookies.
EDIT: I think the cookies are already parsed in the response you get, so this should be a fairly simple task.
Re: Webrequest + Cookies...
I was playing with some commands and saw we had the cookie saved...
as it showed up...just didnt know how to...reuse it.
Re: Webrequest + Cookies...
Quote:
Originally Posted by
TCarter
I was playing with some commands and saw we had the cookie saved...
as it showed up...just didnt know how to...reuse it.
Well did you get it figured out now? If so, mark the thread as resolved :)
Re: Webrequest + Cookies...
havnt had time to play with it to be honest, but i will if this works.