makeHEADRequest

String[][] sutil.makeHEADRequest ( String url )

Description

Retrieve the response header contents.

Parameters

  • url URL encoded version of page request, as a string. Java provides a URLEncoder to aid in URL encoding of a string.

Return Values

Returns contents of the response, as a two-dimensional array.

Change Log

Version Description
5.0 Added for all editions.

This method will use any proxy settings that have been specified in the Settings dialog box..

Examples

Retrieve Page Contents

 // Log HEAD contents

 // Get head contents
 headerArray = sutil.makeHEADRequest("http://www.screen-scraper.com/tutorial/basic_form.php?text_string=Hello+World");

 // Loop through HEAD contents
 for (int i=0; i<headerArray.length; i++)
 {
     // Write header to log
     session.log(headerArray[i][0] + ": " + headerArray[i][1]);
 }

 /* Example Log:
 Date: Fri, 04 Jun 2010 17:18:11 GMT
 Server: Apache/2.2.3 (CentOS)
 X-Powered-By: PHP/5.1.6
 Connection: close
 Content-Type: text/html; charset=UTF-8
 */

See Also