Home Products Downloads Knowledge Base Links And Awards Contact Us
abspdf.com::Knowledge Base
Knowledge Base
      absPDF-Creator Easy
      absPDF-Spool Base
      absPDF-Spool CMD
      absTools-SendMail CMD
      absPDF-Creator Easy


absoluteTools - HTTP is a Com Activex Object created to let developers simulate interaction with web pages from Windows-based applications, using any Com-aware programming language, like Visual Basic, Visual C++  or Delphi. The usage is very simple as show by the supplied VB example project.
This control supports both HTTP and HTTPS protocols and is very suitable to create web spiders, automation tools and secure file transfer utilities.

The trial version downloaded from the website http://www.abspdf.com is fully functional with a limit of 60-days of free evaluation. To use the control beyond the 60-days trial period just register the object by providing a valid license code.

To obtain a license code visit http://www.abspdf.com.

Top ]

Getting started

Register the control

First you need to register the control. Open a "Command Prompt" window, go to the folder where you unpacked the files and type:
regsvr32   absTools-HTTP.dll

To use the control in Visual Basic

Create a new project. See Demo.vbp as an example.

  1. From menu: Project ->  References...
    Check 'absTools - HTTP'

  2. Create object:
    Dim objMyControl As Object
    Dim TmpContent As String
    Set objMyControl = CreateObject("absTools-HTTP")

  3. Unlock the control (if you have a valid key, otherwise just skip to the next item):
    retVal = objMyControl.Unlock("Name", "MyCompany", "unlock_key")

  4. Init the control with the timeout, user-agent string, cookie support activation, external cookie file, no proxy (enter empty values for defaults):
    retVal = objMyControl.Init("200", "", "", "", "", "", "", "")

  5. Add a GET text field:
    retVal = objMyControl.GETAddTextField("q", "absolutePDF")

  6. Send request with current field list to the specified URL:
    retVal = objMyControl.SendRequest("http//www.google.com/search", "", "GET", "")

  7. Use the response as you prefer (in this example we save it to a file):
    TmpContent = objMyControl.ResponseContent()
    TempFileName = ".\test.html"
    filenum = FreeFile
    Open TempFileName For Binary Access Write As #filenum
    Put #filenum, , TmpContent
    Close #filenum
For each step you can test retVal to see if there was an error: if retVal is empty the action succeeded (save for ResponseContent(), see Usage for more information), otherwise you get a text string representing the error (see later for details).

Top ]


Library absTools - HTTP


Function ClearFields() As String
Clear fields list.
- <empty string>: ok

Function Close() As String
Close the session, saving cookies if an external cookie file was specified.
- <empty string>: ok

Function Decode64(pathname_fileout As String, encoded_string As String) As String
Decode the encoded_string and save it to pathname_fileout.
- <empty string>: ok

Function GETAddTextField(field_name As String, field_value As String) As String
Add text field to the field list for a GET operation.
- <empty string>: ok
- "ERROR_FIELDNAME_EMPTY": fieldname cannot be empty

Function Init(timeout As String, user-agent As String, activate_cookies As String, cookie_file as String, proxy_server As String, proxy_port As String, proxy_user As String, proxy_pass As String) As String
Use this method first to set the timeout, user-agent string, cookie support and in case external cookie save file (only permanent cookies are saved, temporary ones are stored internally only for the duration of the session with the control). Leave blank ("") any field for default values (120 sec., Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0), cookie support off). To enable using a proxy server fill in proxy_server and proxy_port, if the proxy server requires basic authentication please set also proxy_user and proxy_pass
- <empty string>: ok

Function POSTAddFileField(file_field_name As String, file_pathname As String) As String
Add file field to the field list for a POST operation.
- <empty string>: ok
- "ERROR_FIELDNAME_EMPTY": fieldname cannot be empty
- "ERROR_INVALID_FILE": the specified file doesn't exist or is not readable

Function POSTAddTextField(field_name As String, field_value As String) As String
Add text field to the field list for a POST operation.
- <empty string>: ok
- "ERROR_FIELDNAME_EMPTY": fieldname cannot be empty

Function RequestRaw() As String
Read current request as a raw string (with headers). Useful for debugging.
- the raw request

Function ResponseBaseURI() As String
Read current response base URI (can be different from request from redirections).
- current response base URI

Function ResponseCode() As String
Read current response code.
- current response code

Function ResponseContent() As String
Read current response content.
- current response content

Function ResponseMessage() As String
Read current response message.
- current response message

Function ResponseRaw() As String
Read current response as a raw string (with headers).
- current raw response

Function SendRequest(url As String, referer As String, type As String, content-type As String) As String
Send request with the current field list (type can ge GET or POST, referer simulates coming from another webpage, content-type can be set "form-data" as opposed to the default type for the type specified: not applicable for GET requests, "application/x-www-form-urlencoded" for POST requests without file fields, "form-data" for POST requests with file fields).
The URL parameter must be in the form "http://xxxxxx" or "https://xxxxxx". No other protocols are supported at the moment. To specify a different port use the form "http://www.mysite.com:1000" (for port 1000, for instance).
To manage basic authentication use the form "http://username:password@www.mysite.com".
- "RESPONSE_SUCCESS": the request received a response of success
- "RESPONSE_INFO": the request received a response of informational content (use ResponseRaw() method to get more information)
- "RESPONSE_REDIRECT": the request received a response of redirect (for POST requests, since GET requests get automatically redirected)
- "RESPONSE_ERROR": the request received a response of error (use ResponseCode() and ResponseMessage() for more information)
- "ERROR_EMPTY_URL": the url specified cannot be empty
- "ERROR_UNSUPPORTED_PROTOCOL": only http:// and https:// are allowed
- "ERROR_EMPTY_POST_FIELDS": for a POST request you need to specify at leat one text or file field
- "ERROR_EXPIRED_EVALUATION": the evaluation 60-days period is over, please register the control to continue using it

Function SetRequestBody(request_body As String) As String
Set body for current request (for custom applications like SOAP).
- <empty string>: ok

Function Unlock(username As String, company As String, key As String) As String
Unlock the module with a valid key, see http://www.abspdf.com for information.
- <empty string>: ok
- "ERROR_INCORRECT_KEY": the key isn't invalid or doesn't match the version or the information supplied
- "ERROR_EXPIRED_EVALUATION": the evaluation 60-days period is over, please register the control to continue using it
- "ERROR_UNREGISTERED_VERSION": the control is being used in free trial mode
- "ERROR_TOO_MANY_KEY_GUESSES": a wrong activation code has been supplied too many times, please try again after 24 hours

Top ]


absoluteTools - HTTP is a Copyright 2004-2005 the absolutePDF Team

All rights reserved.

The software is given "as is". No responsibility shall be assumed by the authors for loss or damage, whether real or consequential, arising from its use. By using the software you explicitly agree to hold the authors blameless for any such losses or damages.

Please visit http://www.abspdf.com for more information.

Top ]