Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  Networking, Protocols & Data Formats

HttpOpenRequest Function


Creates an HTTP request handle.

Syntax

HINTERNET HttpOpenRequest%(
    IN HINTERNET hConnect,
    IN LPCTSTR% lpszVerb,
    IN LPCTSTR% lpszObjectName,
    IN LPCTSTR% lpszVersion,
    IN LPCTSTR% lpszReferer,
    IN LPCTSTR% FAR * lpszAcceptTypes,
    IN DWORD dwFlags,
    IN DWORD dwContext
);

The actual syntax of this function varies between its ANSI and Unicode implementations. See the Win32 Internet Functions Syntax document for details.

Parameters

hConnect
HINTERNET handle to an HTTP session returned by InternetConnect.
lpszVerb
Address of a string that contains the verb to use in the request. If this parameter is NULL, the function uses GET as the verb.
lpszObjectName
Address of a string that contains the name of the target object of the specified verb. This is generally a file name, an executable module, or a search specifier.
lpszVersion
Address of a string that contains the HTTP version. If this parameter is NULL, the function uses HTTP/1.0 as the version.
lpszReferer
Address of a string that specifies the address (URL) of the document from which the URL in the request (lpszObjectName) was obtained. If this parameter is NULL, no "referrer" is specified.
lpszAcceptTypes
Address of a null-terminated array of string pointers indicating media types accepted by the client. If this parameter is NULL, no types are accepted by the client. Servers interpret a lack of accept types to indicate that the client accepts only documents of type "text/*" (that is, only text documents, and not pictures or other binary files). For a listing of valid media types, see Media Types at ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types Non-MS link.
dwFlags
Unsigned long integer value that contains the Internet flag values. Can be any of the following values:
INTERNET_FLAG_CACHE_IF_NET_FAIL
INTERNET_FLAG_HYPERLINK
INTERNET_FLAG_IGNORE_CERT_CN_INVALID
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
INTERNET_FLAG_KEEP_CONNECTION
INTERNET_FLAG_NEED_FILE
INTERNET_FLAG_NO_AUTH
INTERNET_FLAG_NO_AUTO_REDIRECT
INTERNET_FLAG_NO_CACHE_WRITE
INTERNET_FLAG_NO_COOKIES
INTERNET_FLAG_NO_UI
INTERNET_FLAG_PRAGMA_NOCACHE
INTERNET_FLAG_RELOAD
INTERNET_FLAG_RESYNCHRONIZE
INTERNET_FLAG_SECURE
dwContext
Unsigned long integer value that contains the application-defined value that associates this operation with any application data.

Return Value

Returns a valid (non-NULL) HTTP request handle if successful, or NULL otherwise. To get extended error information, call GetLastError.

Remarks

HttpOpenRequest creates a new HTTP request handle and stores the specified parameters in that handle. An HTTP request handle holds a request to be sent to an HTTP server and contains all RFC822/MIME/HTTP headers to be sent as part of the request.

Function Information

Windows NT Use version 4.0 and later. Implemented as ANSI and Unicode functions.
Windows Use Windows 95 and later. Implemented as ANSI and Unicode functions.
Header Wininet.h
Import library Wininet.lib
Minimum availability Internet Explorer 3.0 (ANSI only), 5 (ANSI and Unicode)

See Also

Microsoft Win32 Internet Functions Overview, HTTP Sessions, Microsoft Win32 Internet Functions Reference, HTTP Functions


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site