A must have! Send HTML headers.

By | 2002-06-01

This is the data that you must send to a server when requesting an HTML page. If you are using a control such as the Microsoft Internet control then you do not need this. If you are building a source grabber or something like that, then you will need this.

Original Author: gHost_44

Inputs

at least some form of internet connection. I used mswinsck.ocx for my control and I have this code located in the winsock_connect event.

Side Effects

non so far

Code

'As you can see I have a winsock control named sckURL.
'You can change that to anythign you wish.
With sckURL
    .SendData "GET /" & tPage & " HTTP/1.1" & vbCrLf
    .SendData "Accept: text/plain" & vbCrLf
    .SendData "Accept-Language: en-us" & vbCrLf
    .SendData "Accept-Encoding: gzip, deflate" & vbCrLf
    .SendData "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)" & vbCrLf
    .SendData "Host: " & varDom & vbCrLf
    
    .SendData "Connection: Keep-Alive" & vbCrLf & vbCrLf
  End With

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.