GetHTTPHeader()
语法
Result$ = GetHTTPHeader(URL$)概要
Get the HTTP headers of the given URL.
参数
URL$ The URL for the query. The URL must be fully qualified, and must include the "http://" prefix.
返回值
Returns a string containing the header lines. Each line ends with a Chr(10) character. StringField() can be used to split it into several strings.
The content of the headers are dependent on the type of server and therefore their contents vary, but the header that is returned by that server, provides very useful information about the file, such as the date, the server type, the version, and more.
Remarks
InitNetwork() has to be called before using this command.
示例
InitNetwork() Header$ = GetHTTPHeader("http://www.purebasic.com/index.php3") Repeat Index+1 Line$ = StringField(Header$, Index, #LF$) Debug Line$ Until Line$ = ""Example of returned headers:HTTP/1.1 200 OK Date: Fri, 21 Mar 2008 09:49:30 GMT Server: Apache/1.3.34 (Debian) mod_vhost_online/1.1 mod_fastcgi/2.4.2 mod_log_online/0.1 X-Powered-By: PHP/4.4.8-1 Content-Type: text/html
参阅
ReceiveHTTPFile(), URLEncoder()
已支持操作系统
所有