HttpOpenRequest

更新时间:2025-05-19 17:45:45 阅读: 评论:0

HttpOpenRequest

一旦和伺服器的连线已经建立,我们打开了想要的档案。HttpOpenRequest和HttpSendRequest一起工作打开档案。HttpOpenRequest去创建个请求句柄并且把参数存储在句柄中。HttpSendRequest把请求参数送到HTTP伺服器。

基本介绍

外文名:HttpOpenRequest 档案名称:WinINet.dll 共同工作档案:HttpSendRequest 领域:程式设计

所处动态程式库的档案名称:WinINet.dllHINTERNET hHttpFile = ::HttpOpenRequest(hConnect, // 1 HINTERNET hHttpSession"GET",// 2 LPCTSTR lpszVerb"/MSDN/MSDNINFO/", // 3 LPCTSTR lpszObjectNameHTTP_VERSION, // 4 LPCTSTR lpszVersionNULL,// 5 LPCTSTR lpszReferer0, // 6 LPCTSTR FAR * lplpszAcceptTypesINTERNET_FLAG_DONT_CACHE, // 7 DWORD dwFlags0 // 8 DWORD dwContext) ;返回创建请求的句柄。参数<1>的名称为“hConnect”,类型为“整数型”。就是Internet的连线句柄参数<2>的名称为“lpszVerb”,类型为“文本型”。访问方式。在网页里只有get和post两种方法参数<3>的名称为“lpszObjectName”,类型为“文本型”。页面的地址参数<4>的名称为“lpszVersion”,类型为“文本型”。协定的版本“HTTP/1.1”现在通用的是这样。貌似听说过2.0,但是不懂是啥意思。参数<5>的名称为“lpszReferer”,类型为“文本型”。引用页,抓包得到的refer参数<6>的名称为“lplpszAcceptTypes”,类型为“文本型”。参数<7>的名称为“dwFlags”,类型为“整数型”。2147483648参数<8>的名称为“dwContext”,类型为“整数型”。0如果创建失败。需要释放Internetopen句柄和Internetconnect句柄

Value Description INTERNET_FLAG_CACHE_IF_NET_FAIL Return the resource from the cache if the network request for the resource fails due to an ERROR_INTERNET_CONNECTION_RESET or ERROR_INTERNET_CANNOT_CONNECT.
为资源的网路请求失败返回快取的资源 INTERNET_FLAG_DONT_CACHE Not supported. Data is never cached.
数据没有被快取。 INTERNET_FLAG_HYPERLINK Forces a reload if there was no Expires time and no Last-Modified time returned from the server when determining whether to reload the item from the network.
WinInet函式禁用SSL / TLS证书,是基于对给定的主机名的请求伺服器返回检查。WinInet函式对一个简单的检查,使用证书的主机名称和简单的通配符匹配规则的比较。 INTERNET_FLAG_IGNORE_CERT_CN_INVALID Disables WinInet function checking of SSL/TLS-based certificates that are returned from the server against the host name given in the request. WinInet functions use a simple check against certificates by comparing for matching host names and simple wildcarding rules. INTERNET_FLAG_IGNORE_CERT_DATE_INVALID Disables WinInet function checking of SSL/TLS-based certificates for proper validity dates. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP Disables the ability of the WinInet functions to detect this special type of redirect. When this flag is used, WinInet functions transparently allow redirects from HTTPS to HTTP URLs. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS Disables the ability of the WinInet functions to detect this special type of redirect. When this flag is used, WinInet functions transparently allow redirects from HTTP to HTTPS URLs. INTERNET_FLAG_KEEP_CONNECTION Uses keep-alive semantics, if available, for the connection. This flag is required for Microsoft Network (MSN), NT LAN Manager (NTLM), and other types of authentication. INTERNET_FLAG_MAKE_PERSISTENT Not supported. 不支持 INTERNET_FLAG_MUST_CACHE_REQUEST Causes a temporary file to be created if the file cannot be cached. Identical to the preferred value INTERNET_FLAG_NEED_FILE. INTERNET_FLAG_NEED_FILE Causes a temporary file to be created if the file cannot be cached. INTERNET_FLAG_NO_AUTH Does not attempt authentication automatically. INTERNET_FLAG_NO_AUTO_REDIRECT Does not automatically handle redirection in HttpSendRequest. INTERNET_FLAG_NO_CACHE_WRITE Does not add the returned entity to the cache. If the INTERNET_FLAG_HYPERLINK is also specified, WinInet will create the cache file but will not commit it. INTERNET_FLAG_NO_COOKIES Does not automatically add cookie headers to requests, and does not automatically add returned cookies to the cookie database. INTERNET_FLAG_NO_UI Disables the cookie dialog box. INTERNET_FLAG_PRAGMA_NOCACHE Forces the request to be resolved by the origin server, even if a cached copy exists on the proxy. INTERNET_FLAG_READ_PREFETCH This flag is currently disabled. INTERNET_FLAG_RELOAD Not supported. Data is always from the wire and caching is not supported. INTERNET_FLAG_RESYNCHRONIZE Reloads HTTP resources if the resource has been modified since the last time it was downloaded. INTERNET_FLAG_SECURE Uses SSL/TLS transaction semantics.

本文发布于:2023-03-25 16:43:03,感谢您对本站的认可!

本文链接:http://www.ranqi119.com/to/1679874581233308.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:HttpOpenRequest
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 站长QQ:55-9-10-26|友情:优美诗词|电脑我帮您|扬州装修|369文学|学编程|软件玩家|水木编程|编程频道