|
-
Jan 18th, 2007, 08:30 AM
#1
Thread Starter
New Member
[2005] Download file - specific headers
I need help downloading file, for example http://www.hrt.hr/index.xml
But I need that headers to look like these:
GET /index.xml HTTP/1.1
Host: www.hrt.hr
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://vb.bloger.hr/
Pragma: no-cache
Cache-Control: no-cache
I have tried this:
VB Code:
Dim down As New Net.WebClient
down.Headers.Set(Net.HttpRequestHeader.Host, "www.hrt.hr")
down.Headers.Set(Net.HttpRequestHeader.UserAgent, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1")
down.Headers.Set(Net.HttpRequestHeader.Accept, "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5")
down.Headers.Set(Net.HttpRequestHeader.AcceptLanguage, "en-us,en;q=0.5")
down.Headers.Set(Net.HttpRequestHeader.AcceptCharset, "ISO-8859-1,utf-8;q=0.7,*;q=0.7")
down.Headers.Set(Net.HttpRequestHeader.KeepAlive, "300")
down.Headers.Set(Net.HttpRequestHeader.Connection, "keep-alive")
down.Headers.Set(Net.HttpRequestHeader.Referer, "http://www.vb.bloger.hr/")
down.Headers.Set(Net.HttpRequestHeader.Pragma, "no-cache")
down.Headers.Set(Net.HttpRequestHeader.CacheControl, "no-cache")
down.DownloadFile("http://www.hrt.hr/index.xml", "C:\Downloads\test1.txt")
I also tried with:
But non of them work.
Please help.
Last edited by tomoslav; Feb 9th, 2007 at 05:10 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|