I'm using the HttpRequestHeader
method to make requests ( GET
and POST
), however I'm getting the Location
parameter from the response of a POST
and I'm not able to evolve. You have an example of my request below:
url = "https://www.google.com"
req = HttpWebRequest.Create(url)
req.Method = "POST"
req.Headers.Add(HttpRequestHeader.Cookie, sessao)
req.Headers.Add(HttpRequestHeader.AcceptLanguage, "pt-BR")
req.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0"
req.Referer = "www.google.com.br"
req.ContentType = " multipart/form-data; boundary=---------------------------24708330210100"
req.ContentLength = postData.Length
Dim swRequestWriter As StreamWriter = New StreamWriter(req.GetRequestStream())
swRequestWriter.Write(postData)
swRequestWriter.Close()
Dim srResponseReader As StreamReader = New StreamReader(req.GetResponse().GetResponseStream(), System.Text.Encoding.UTF7)
html = srResponseReader.ReadToEnd().Trim
Remembering that the addresses are fictitious, I would like an urgent help.