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

Workshop  |  Networking, Protocols & Data Formats

HttpQueryInfo Function


Retrieves header information associated with an HTTP request.

Syntax

BOOL HttpQueryInfo%(
    IN HINTERNET hRequest,
    IN DWORD dwInfoLevel,
    IN LPVOID lpvBuffer,
    IN LPDWORD lpdwBufferLength,
    IN OUT LPDWORD lpdwIndex,
);

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

Parameters

hRequest
HINTERNET request handle returned by HttpOpenRequest or InternetOpenUrl.
dwInfoLevel
Unsigned long integer value that contains a combination of an attribute to retrieve and the flags that modify the request. The attribute can be any one of the Attributes and the flag can be any one of the Modifiers on the Query Info Flags page.
lpvBuffer
Address of the buffer that receives the information.
lpdwBufferLength
Address of a value that contains the length of the data buffer. When the function returns, this parameter contains the address of a value specifying the length of the information written to the buffer. When the function returns strings, the following rules apply:
  • If the function succeeds, lpdwBufferLength specifies the length of the string, in characters, minus 1 for the terminating null.
  • If the function fails and ERROR_INSUFFICIENT_BUFFER is returned, lpdwBufferLength specifies the number of bytes that the application must allocate to receive the string.
lpdwIndex
Address of a zero-based header index used to enumerate multiple headers with the same name. When calling the function, this parameter is the index of the specified header to return. When the function returns, this parameter is the index of the next header. If the next index cannot be found, ERROR_HTTP_HEADER_NOT_FOUND is returned.

Return Value

Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError.

Remarks

You can retrieve different types of data from HttpQueryInfo:

If your application needs the data returned as a data type other than a string, you must include the appropriate modifier with the attribute passed to dwInfoLevel.

Example

The following example demonstrates a call to HttpQueryInfo.

bRet = HttpQueryInfo(hResource, HTTP_QUERY_RAW_HEADERS_CRLF,
                   lpvSomeBuffer, &dwSize, NULL));

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, Microsoft Win32 Internet Functions Tutorials, Retrieving HTTP Headers, 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