Setopt

Explanation of the setopt API for wsCurl.

The setopt API enables you to specify options and parameters for the wsCurl functionality. The syntax is as follows:

wsCurl.setopt(Curl.<CURL_OPTIONS>, parameter);

Option Integer Value Definition
CURLOPT_URL 10002 This is the name of the proxy, if a proxy is used. the second parameter should be a string.
CURLOPT_PROXY 10004 This is the full URL that you will perform either a get or a put action upon. The second parameter should be a string.
CURLOPT_PROXYUSRPWD 10006 This is the name and password combination you will use when fetching. The second parameter should be a string.
CURLOPT_PROXYPORT 59 This is the proxy port that you will use. The second parameter should be an integer.
CURLOPT_TIMEOUT 13 This is the number of seconds before the read operation times out. The second parameter should be an integer.
CURLOPT_HEADER 42 This is a Boolean defining if the header will be thrown out in response to the exec operation. The second parameter should be either '0' or '1'. '0' specifies that the header will not be included; '1' specifies that the header will be included.
CURLOPT_SSL_VERIFYPEER 64 This parameter specifies if the verify peer operation in the SSL handshake will or will not occur. . The second parameter should be either '0' or '1'. '0' specifies that the peer will not be verified; '1' specifies that the peer will be verified.
CURLOPT_SSL_VERIFYHOST 81 This parameter specifies if the verify host operation in the SSL handshake will or will not occur. . The second parameter should be either '0', '1', or '2'. '0' specifies that the host will not be verified; '1' specifies that the host's existence will be checked and '2' specifies that the the host matches the provided hostname.
CURLOPT_USERNAME 10173 The email address that will be used to send the mail. The second parameter should be a string.
CURLOPT_PASSWORD 10174 Specifies the password associated with the email address we are using to send the mail. The second parameter should be a string.
CURLOPT_MAIL_FROM 10186 Specifies the SMTP mail originator. The second parameter should be a string.
CURLOPT_MAIL_RCPT 10187 Specifies the SMTP mail recipient. The second parameter should be a string.
CURLOPT_VERBOSE 41 Specifies that step-by-step execution will be recorded and turns on logging. the second parameter should be either '0' or '1'. '0' specifies that verbose mode is not on; '1' specifies that verbose mode and logging are on.
CURLOPT_MAXREDIRS 68 Specifies the maximum number of HTTP redirects that will occur. You can use any number up to XX. The second parameter should be an integer.
CURLOPT_READDATA 10009 Specifies the file stream to use as the input. We will use the email header and body as the input stream. The second parameter should be a string.
CURLOPT_USE_SSL 119

Specifies if SSL/TLS for FTP is enabled. There are four options you can choose, which are as follows. The second parameter should be an integer specifying which option you select.

  • USESSL_NONE: SSL will not be used. The integer value is 0.
  • USESSL_TRY: The connection will attempt to use SSL, but will proceed regardless if SSL can or cannot be used. The integer value is 1.
  • USESSL_CONTROL: If SSL canot be used, the control connection will fail. THe integer value is 2.
  • USESSL_ALL: If SSL cannot be used, all connections will fail. The integer value is 3.