?
Solved

HTTPS GET Query String

Posted on 2007-07-24
7
Medium Priority
?
144 Views
Last Modified: 2013-11-26
Hi,

I need to dowload some data from a third party.  The data is in TSV format and can be obtained using an "https get query string".

I want to write a VB.net app that will download this data on a scheduled basis.  Does anyone have any sample code for this?

thanks
0
Comment
Question by:kinton
  • 3
  • 3
7 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 19557349
You should be able to use the System.Net.WebClient:

    Dim client As New WebClient()
    client.DownloadFile(address, fileName)

where 'address' is the url, and 'fileName' is the local file name.

Bob
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 19557361
You can retrieve content of the page over HTTPS protocol in the same way as you would over the HTTP protocol. Check this link:

http://www.developerfusion.co.uk/show/4637/
0
 
LVL 2

Author Comment

by:kinton
ID: 19557757
ok - Both solutions appear like they should work.

If I type my URL into my browser the download works fine, if I use any of the baove methods I get a 401 error Unauthorized.

any ideas?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 19557862
If you need to pass in credentials:

    Dim client As New WebClient()
    client.Credentials = New NetworkCredentials(userName, password)
    client.DownloadFile(address, fileName)

Bob
0
 
LVL 2

Author Comment

by:kinton
ID: 19557921
I don't think I do.  I do not host the page I am trying to call.  It is on a remote server.  Forgive me if I am missing the point but how will passing network credentials help?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19557970
When you access the URL with the browser, is there anything that you do to gain access?   Does the site require cookies?

Bob
0
 
LVL 2

Author Comment

by:kinton
ID: 19558025
I think so, give me a moment.  I think your suggestion may have worked..
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question