BuildHttpDownloaderSettings

=BuildHttpDownloaderSettings([
bool cache=false,
int pause=0,
string requestMethod,
string requestContentType,
{?R x 2C} requestForm,
{?R x 2C} requestHeaders,
string authenticateUser,
string authenticatePassword,
string requestEncoding,
string responseEncoding,
bool readable=false,
]) : string

Used to create XML settings string for explicitly controlling the HTTP request of functions such as XPathOnUrl, RegexpFindOnUrl,
JsonPathOnUrl and DownloadString.

Parameters

(all parameters are optional)

cache
Should requests be cached if applicable? Not all functions in SeoTools use caching.

pause
How long pause in milliseconds should we wait between requests.

requestMethod
HTTP request method. Normally ‘GET’ or ‘POST’.

requestContentType
Sets the Content-Type HTTP header.

requestForm
Sets HTTP form data parameters. A 2 dimensional vector with 2 columns, where the left column contains
field names and the right values.

If requestForm is specified and requestContentType isn’t, requestContentType is set to ‘application/x-www-form-urlencoded’.

If requestForm is specified and requestMethod isn’t, requestMethod is set to ‘POST’.

requestHeaders
Sets custom HTTP headers. A 2 dimensional vector with 2 columns, where the left column contains
header names and the right values.

authenticateUser
Sets username when requesting a HTTP authentication protected resource.

authenticatePassword
Sets password when requesting a HTTP authentication protected resource.

requestEncoding
Sets the encoding to be used when encoding request content.

responseEncoding
Specify what encoding to expect in response.

readable=false
Whether the output should be nicely formatted.

For instructions how to use this function, look at example in /cookbook/BuildHttpDownloaderSettings.xsl.
Use http://seotools.nielsbosma.se/HttpDebugger.aspx to debug your HTTP request.

It also possible to setup a default HttpDownloader config directly in SeoTools.config.xml. Note this will affect the default
configuration of all functions that fetch data from the internet.

Get help with this function in the SeoTools Community Forum.

 

Comments are closed.