Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

SAMPLE: Vbhttp.exe Demonstrates How to Use HTTP WinInet APIs in Visual Basic


View products that this article applies to.

Summary

The Vbhttp.exe file is a sample that demonstrates how to use Win32 Internet (WinInet) HTTP application programming interfaces (APIs) in Visual Basic.

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support Files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Vbhttp.exe contains the following files:

File nameSize
EULA.txt1610
Http.frm37900
Http.txt71
Mssccprj.scc191
Vbhttp.vbp796
Vbhttp.vbw89
WinInet.bas6150


The sample demonstrates the following concepts:
  • How to use the GET/POST method to send an HTTP/HTTPS request and how to read the response from the server.

    This sample uses the same proxy setting in Internet Explorer by passing INTERNET_OPEN_TYPE_PRECONFIG to the InternetOpen function.
  • How to handle proxy/Web server authentication.

    This sample calls InternetSetOption (no UI) to set the credential after it detects the 407 (proxy server) or 401 (Web server) status code. To display the built-in logon dialog box in Internet Explorer, call the InternetErrorDlg function instead. For Web server authentication, you can directly pass the user name and password to the InternetConnect function, if you already have them.
  • How to handle invalid certificate authority error (12045).

    This sample uses InternetSetOption (no UI) to ignore the error after HttpSendRequest fails. You can use the InternetErrorDlg function (with UI) as well.

↑ Back to the top


References

For a list of all WinInet APIs, see the following MSDN Web Workshop site (click Win32 Internet Functions in the left frame): For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
165298 HOWTO: Simulate a Form POST Request Using WinInet
195650 HOWTO: Handle Proxy Authorization with WinInet
254396 PRB: Cannot Connect Through Proxy Server that Requires NTLM Authentication
168151 HOWTO: Make SSL Requests Using WinInet
182888 HOWTO: Handle Invalid Certificate Authority Error with WinInet
193625 WinInet Error Codes (12001 through 12156)
185519 FILE: Vbinet.exe WinInet API Declarations for Visual Basic
175179 FILE: VBFTP.EXE: Implementing FTP Using WinInet API from VB
195653 SAMPLTE: Using FTP WinInet APIs in Visual Basic with SimpleFtp

↑ Back to the top


Keywords: kbdownload, kbftp, kbhowto, kbhttp, KB259100

↑ Back to the top

Article Info
Article ID : 259100
Revision : 8
Created on : 8/11/2004
Published on : 8/11/2004
Exists online : False
Views : 543