2
I’m using the method HttpRequestHeader
to make requests (GET
and POST
), but I need to take the parameter Location
of the response of a POST
and I am unable to evolve. There is 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"
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.