Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.
Platforms to show: All Mac Windows Linux Cross-Platform
CURLNMBS.GetInfoSizeDownload as Double
Function:
The total amount of bytes that were downloaded.
Notes:
The Lasterror property is set. 0 for success.
The amount is only for the latest transfer and will be reset again for each new transfer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
The Lasterror property is set. 0 for success.
The amount is only for the latest transfer and will be reset again for each new transfer.
CURLNMBS.GetInfoSizeUpload as Double
Function:
The total amount of bytes that were uploaded.
Notes: The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: The Lasterror property is set. 0 for success.
CURLNMBS.GetInfoSpeedDownload as Double
Function:
The average download speed that CURL measured for the complete download.
Notes: The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: The Lasterror property is set. 0 for success.
CURLNMBS.GetInfoSpeedUpload as Double
Function:
The average upload speed that CURL measured for the complete upload.
Notes: The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: The Lasterror property is set. 0 for success.
CURLNMBS.GetInfoSSLEngines as CURLNListMBS
Function:
Receive a linked-list of OpenSSL crypto-engines supported.
Notes:
The Lasterror property is set. 0 for success.
Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
The Lasterror property is set. 0 for success.
Note that engines are normally implemented in separate dynamic libraries. Hence not all the returned engines may be available at run-time.
CURLNMBS.GetInfoSSLVerifyResult as Integer
Function:
the result of the certification verification that was requested (using the SSLVerifyPeer option).
Notes: The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: The Lasterror property is set. 0 for success.
CURLNMBS.GetInfoStartTransferTime as Double
Function:
the time, in seconds, it took from the start until the first byte is just about to be transferred.
Notes:
The Lasterror property is set. 0 for success.
This includes the pretransfer time and also the time the server needs to calculate the result.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
The Lasterror property is set. 0 for success.
This includes the pretransfer time and also the time the server needs to calculate the result.
CURLNMBS.GetInfoTotalTime as Double
Function:
The total time in seconds for the previous transfer, including name resolving, TCP connect etc.
Notes: The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: The Lasterror property is set. 0 for success.
CURLNMBS.OpenMTInputFile(file as folderitem, Offset as Integer = 0) as boolean
Function:
Opens input file for reading data while PerformMT runs.
Notes:
The read event is not called with PerformMT.
Offset is helpful for HTTP PUT requests with range, so you can start with an offset.
With 15.2 version of plugin, this also works with Perform.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 11.2 | Yes | Yes | Yes | Yes | No |
Notes:
The read event is not called with PerformMT.
Offset is helpful for HTTP PUT requests with range, so you can start with an offset.
With 15.2 version of plugin, this also works with Perform.
CURLNMBS.Perform as Integer
Function:
Perform a file transfer
Notes:
This function is called after all the options are set, and will perform the transfer as described in the options.
You can do any amount of calls to Perform. If you intend to transfer more than one file, you are even encouraged to do so. libCURL will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. Just note that you will have to use the option properties between the invokes to set options for the following Perform.
Typical error codes are 6 for a wrong domain name in the URL, 67 for wrong name/password combination, 60 for missing SSL settings, 1 for an unsupported protocol.
Possible values for the retun value:
The error value -1 is used from the plugin to report that something is missing like OpenSSL dlls on Windows.
With SFTP, you can get logged error "Upload failed: Operation failed (4/-31)" when upload uses path to folder instead of file in URL.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
This function is called after all the options are set, and will perform the transfer as described in the options.
You can do any amount of calls to Perform. If you intend to transfer more than one file, you are even encouraged to do so. libCURL will then attempt to re-use the same connection for the following transfers, thus making the operations faster, less CPU intense and using less network resources. Just note that you will have to use the option properties between the invokes to set options for the following Perform.
Typical error codes are 6 for a wrong domain name in the URL, 67 for wrong name/password combination, 60 for missing SSL settings, 1 for an unsupported protocol.
Possible values for the retun value:
const kError_FunctionMissing | = -1 | |
const kError_OK | = 0 | |
const kError_UNSUPPORTED_PROTOCOL, | = 1 | |
const kError_FAILED_INIT, | = 2 | |
const kError_URL_MALFORMAT, | = 3 | |
const kError_URL_MALFORMAT_USER, | = 4 | (NOT USED) |
const kError_COULDNT_RESOLVE_PROXY, | = 5 | |
const kError_COULDNT_RESOLVE_HOST, | = 6 | |
const kError_COULDNT_CONNECT, | = 7 | |
const kError_FTP_WEIRD_SERVER_REPLY, | = 8 | |
const kError_FTP_ACCESS_DENIED, | = 9 | a service was denied by the FTP server due to lack of access when login fails this is not returned. |
const kError_FTP_USER_PASSWORD_INCORRECT, | = 10 | |
const kError_FTP_WEIRD_PASS_REPLY, | = 11 | |
const kError_FTP_WEIRD_USER_REPLY, | = 12 | |
const kError_FTP_WEIRD_PASV_REPLY, | = 13 | |
const kError_FTP_WEIRD_227_FORMAT, | = 14 | |
const kError_FTP_CANT_GET_HOST, | = 15 | |
const kError_FTP_CANT_RECONNECT, | = 16 | |
const kError_FTP_COULDNT_SET_BINARY, | = 17 | |
const kError_PARTIAL_FILE, | = 18 | |
const kError_FTP_COULDNT_RETR_FILE, | = 19 | |
const kError_FTP_WRITE_ERROR, | = 20 | |
const kError_FTP_QUOTE_ERROR, | = 21 | |
const kError_HTTP_RETURNED_ERROR, | = 22 | |
const kError_WRITE_ERROR, | = 23 | |
const kError_MALFORMAT_USER, | = 24 | NOT USED |
const kError_FTP_COULDNT_STOR_FILE, | = 25 | failed FTP upload |
const kError_READ_ERROR, | = 26 | could open/read from file |
const kError_OUT_OF_MEMORY, | = 27 | |
const kError_OPERATION_TIMEOUTED, | = 28 | the timeout time was reached |
const kError_FTP_COULDNT_SET_ASCII, | = 29 | TYPE A failed |
const kError_FTP_PORT_FAILED, | = 30 | FTP PORT operation failed |
const kError_FTP_COULDNT_USE_REST, | = 31 | the REST command failed |
const kError_FTP_COULDNT_GET_SIZE, | = 32 | the SIZE command failed |
const kError_HTTP_RANGE_ERROR, | = 33 | RANGE "command" didn't work |
const kError_HTTP_POST_ERROR, | = 34 | |
const kError_SSL_CONNECT_ERROR, | = 35 | wrong when connecting with SSL |
const kError_BAD_DOWNLOAD_RESUME, | = 36 | couldn't resume download |
const kError_FILE_COULDNT_READ_FILE, | = 37 | |
const kError_LDAP_CANNOT_BIND, | = 38 | |
const kError_LDAP_SEARCH_FAILED, | = 39 | |
const kError_LIBRARY_NOT_FOUND, | = 40 | |
const kError_FUNCTION_NOT_FOUND, | = 41 | |
const kError_ABORTED_BY_CALLBACK, | = 42 | |
const kError_BAD_FUNCTION_ARGUMENT, | = 43 | |
const kError_BAD_CALLING_ORDER, | = 44 | NOT USED |
const kError_INTERFACE_FAILED, | = 45 | CURLOPT_INTERFACE failed |
const kError_BAD_PASSWORD_ENTERED, | = 46 | NOT USED |
const kError_TOO_MANY_REDIRECTS , | = 47 | catch endless re-direct loops |
const kError_UNKNOWN_TELNET_OPTION, | = 48 | User specified an unknown option |
const kError_TELNET_OPTION_SYNTAX , | = 49 | Malformed telnet option |
const kError_OBSOLETE, | = 50 | NOT USED |
const kError_SSL_PEER_CERTIFICATE, | = 51 | peer's certificate wasn't ok |
const kError_GOT_NOTHING, | = 52 | when this is a specific error |
const kError_SSL_ENGINE_NOTFOUND, | = 53 | SSL crypto engine not found |
const kError_SSL_ENGINE_SETFAILED, | = 54 | can not set SSL crypto engine as default |
const kError_SEND_ERROR, | = 55 | failed sending network data |
const kError_RECV_ERROR, | = 56 | failure in receiving network data |
const kError_SHARE_IN_USE, | = 57 | share is in use |
const kError_SSL_CERTPROBLEM, | = 58 | problem with the local certificate |
const kError_SSL_CIPHER, | = 59 | couldn't use specified cipher |
const kError_SSL_CACERT, | = 60 | problem with the CA cert (path?) |
const kError_BAD_CONTENT_ENCODING, | = 61 | Unrecognized transfer encoding |
const kError_LDAP_INVALID_URL, | = 62 | Invalid LDAP URL |
const kError_FILESIZE_EXCEEDED, | = 63 | Maximum file size exceeded |
const kError_FTP_SSL_FAILED, | = 64 | Requested FTP SSL level failed |
const kError_SEND_FAIL_REWIND, | = 65 | Sending the data requires a rewind that failed |
const kError_SSL_ENGINE_INITFAILED, | = 66 | failed to initialise ENGINE |
const kError_LOGIN_DENIED, | = 67 | user, password or similar was not accepted and we failed to login |
The error value -1 is used from the plugin to report that something is missing like OpenSSL dlls on Windows.
With SFTP, you can get logged error "Upload failed: Operation failed (4/-31)" when upload uses path to folder instead of file in URL.
CURLNMBS.PerformMT as Integer
Function:
Perform a file transfer with preemptive multithreading.
Notes:
Same as Perform, but with additional multithreading.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
As the actual transfer runs on a preemptive thread, the events Debug, Write, Header and Progress are called asynchrounously and run a few milliseconds later. You can return true in Progress event to stop transfer, but you will get more events before the transfer is stopped.
You can call CreateMTDebugOutputFile, CreateMTHeaderOutputFile and CreateMTOutputFile before PerformMT to have output data be written into files. Call OpenMTInputFile to let the plugin read input data (form post or upload) from an input file.
Do not call other CURL functions on this CURLNMBS instance while PerformMT is running!
Typical error codes are 6 for a wrong domain name in the URL, 67 for wrong name/password combination, 60 for missing SSL settings, 1 for an unsupported protocol.
To avoid trouble with app hanging on quit of application, be sure to set cancel property to true in window close event to cancel any pending transfer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 11.2 | Yes | Yes | Yes | Yes | No |
Notes:
Same as Perform, but with additional multithreading.
Must be called inside a Xojo (Real Studio) thread so time yields to main thread and you can keep the GUI running.
As the actual transfer runs on a preemptive thread, the events Debug, Write, Header and Progress are called asynchrounously and run a few milliseconds later. You can return true in Progress event to stop transfer, but you will get more events before the transfer is stopped.
You can call CreateMTDebugOutputFile, CreateMTHeaderOutputFile and CreateMTOutputFile before PerformMT to have output data be written into files. Call OpenMTInputFile to let the plugin read input data (form post or upload) from an input file.
Do not call other CURL functions on this CURLNMBS instance while PerformMT is running!
Typical error codes are 6 for a wrong domain name in the URL, 67 for wrong name/password combination, 60 for missing SSL settings, 1 for an unsupported protocol.
To avoid trouble with app hanging on quit of application, be sure to set cancel property to true in window close event to cancel any pending transfer.
CURLNMBS.ReceiveData(byref data as Memoryblock, BytesToRead as Int64) as Int64
Function:
Receives raw data on a connection.
Notes:
This function receives raw data from the established connection. You may use it together with SendData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
The data memoryblock is a reference to your variable that will get the received data. BytesToRead is the maximum amount of data you can get in that buffer. The function returns the number of received bytes.
To establish the connection, set OptionConnectOnly = true before calling Perform. Note that ReceiveData does not work on connections that were created without this option.
The call will return kError_AGAIN if there is no data to read - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, wait for data to arrive.
Wait on the socket only if ReceiveData returns kError_AGAIN. The reason for this is libcurl or the SSL library may internally cache some data, therefore you should call ReceiveData until all data is read which would include any cached data.
Furthermore if you wait on the socket and it tells you there is data to read, ReceiveData may return CURLE_AGAIN if the only data that was read was for internal SSL processing, and no other data is available.
On success, sets lasterror to kError_OK (0), stores the received data into memory block, and returns the number of bytes it actually read.
On failure, returns zero and lasterror is set to the appropriate error code.
The function may return kError_AGAIN. In this case, use your operating system facilities to wait until data can be read, and retry.
Reading exactly 0 bytes indicates a closed connection.
If there's no socket available to use from the previous transfer, this function returns kError_UNSUPPORTED_PROTOCOL.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 17.2 | Yes | Yes | Yes | Yes | No |
Notes:
This function receives raw data from the established connection. You may use it together with SendData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
The data memoryblock is a reference to your variable that will get the received data. BytesToRead is the maximum amount of data you can get in that buffer. The function returns the number of received bytes.
To establish the connection, set OptionConnectOnly = true before calling Perform. Note that ReceiveData does not work on connections that were created without this option.
The call will return kError_AGAIN if there is no data to read - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, wait for data to arrive.
Wait on the socket only if ReceiveData returns kError_AGAIN. The reason for this is libcurl or the SSL library may internally cache some data, therefore you should call ReceiveData until all data is read which would include any cached data.
Furthermore if you wait on the socket and it tells you there is data to read, ReceiveData may return CURLE_AGAIN if the only data that was read was for internal SSL processing, and no other data is available.
On success, sets lasterror to kError_OK (0), stores the received data into memory block, and returns the number of bytes it actually read.
On failure, returns zero and lasterror is set to the appropriate error code.
The function may return kError_AGAIN. In this case, use your operating system facilities to wait until data can be read, and retry.
Reading exactly 0 bytes indicates a closed connection.
If there's no socket available to use from the previous transfer, this function returns kError_UNSUPPORTED_PROTOCOL.
CURLNMBS.Reset
Function:
Re-initializes all options previously set on a specified CURL handle to the default values.
Notes: It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes: It does not change the following information kept in the handle: live connections, the Session ID cache, the DNS cache, the cookies and shares.
CURLNMBS.SendData(data as Memoryblock) as Integer
Function:
Sends raw data over a connection.
Notes:
This function sends arbitrary data over the established connection. You may use it together with ReceiveData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
Provide the data to send via parameter. We return the number of bytes sent.
To establish the connection, set OptionConnectOnly = true option before calling Perform methods. Note that SendData will not work on connections that were created without this option.
The call will return kError_AGAIN if it's not possible to send data right now - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, please wait.
Furthermore if you wait on the socket and it tells you it's writable, SendData may return kError_AGAIN if the only data that was sent was for internal SSL processing, and no other data could be sent.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 15.2 | Yes | Yes | Yes | Yes | No |
Notes:
This function sends arbitrary data over the established connection. You may use it together with ReceiveData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
Provide the data to send via parameter. We return the number of bytes sent.
To establish the connection, set OptionConnectOnly = true option before calling Perform methods. Note that SendData will not work on connections that were created without this option.
The call will return kError_AGAIN if it's not possible to send data right now - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, please wait.
Furthermore if you wait on the socket and it tells you it's writable, SendData may return kError_AGAIN if the only data that was sent was for internal SSL processing, and no other data could be sent.
See also:
CURLNMBS.SendData(data as string) as Integer
Function:
Sends raw data over a connection.
Notes:
This function sends arbitrary data over the established connection. You may use it together with ReceiveData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
Provide the data to send via parameter. We return the number of bytes sent.
To establish the connection, set OptionConnectOnly = true option before calling Perform methods. Note that SendData will not work on connections that were created without this option.
The call will return kError_AGAIN if it's not possible to send data right now - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, please wait.
Furthermore if you wait on the socket and it tells you it's writable, SendData may return kError_AGAIN if the only data that was sent was for internal SSL processing, and no other data could be sent.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 15.2 | Yes | Yes | Yes | Yes | No |
Notes:
This function sends arbitrary data over the established connection. You may use it together with ReceiveData to implement custom protocols using libcurl. This functionality can be particularly useful if you use proxies and/or SSL encryption: libcurl will take care of proxy negotiation and connection set-up.
Provide the data to send via parameter. We return the number of bytes sent.
To establish the connection, set OptionConnectOnly = true option before calling Perform methods. Note that SendData will not work on connections that were created without this option.
The call will return kError_AGAIN if it's not possible to send data right now - the socket is used in non-blocking mode internally. When kError_AGAIN is returned, please wait.
Furthermore if you wait on the socket and it tells you it's writable, SendData may return kError_AGAIN if the only data that was sent was for internal SSL processing, and no other data could be sent.
See also:
CURLNMBS.SetInputData(data as MemoryBlock)
Function:
Sets the input data.
Notes:
If you set input data, you do not need to use Read, RestartRead or Seek events.
The plugin will use the provided data for the upload.
Setting input data size, will also set the input file size (OptionInFileSizeLarge and OptionInFileSize).
Alternatively you can provide data in Read event or use OpenMTInputFile method to open a file on disk to upload.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 14.0 | Yes | Yes | Yes | Yes | No |
Notes:
If you set input data, you do not need to use Read, RestartRead or Seek events.
The plugin will use the provided data for the upload.
Setting input data size, will also set the input file size (OptionInFileSizeLarge and OptionInFileSize).
Alternatively you can provide data in Read event or use OpenMTInputFile method to open a file on disk to upload.
See also:
CURLNMBS.SetInputData(data as string)
Function:
Sets the input data.
Notes:
If you set input data, you do not need to use Read, RestartRead or Seek events.
The plugin will use the provided data for the upload.
Setting input data size, will also set the input file size (OptionInFileSizeLarge and OptionInFileSize).
Alternatively you can provide data in Read event or use OpenMTInputFile method to open a file on disk to upload.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 14.0 | Yes | Yes | Yes | Yes | No |
Notes:
If you set input data, you do not need to use Read, RestartRead or Seek events.
The plugin will use the provided data for the upload.
Setting input data size, will also set the input file size (OptionInFileSizeLarge and OptionInFileSize).
Alternatively you can provide data in Read event or use OpenMTInputFile method to open a file on disk to upload.
See also:
CURLNMBS.SetOptionConnectTo(list() as string)
Function:
Set list of host:port:connect-to-host:connect-to-port, overrides the URL's host:port (only for the network layer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 18.2 | Yes | Yes | Yes | Yes | No |
CURLNMBS.SetOptionEmptyPassword
Function:
Sets an empty password.
Notes:
Normally you have no password unless you set it.
But if you set a password with empty string, the plugin sets CURL to use no password.
This method is to use an empty password.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 15.3 | Yes | Yes | Yes | Yes | No |
Notes:
Normally you have no password unless you set it.
But if you set a password with empty string, the plugin sets CURL to use no password.
This method is to use an empty password.
CURLNMBS.SetOptionHTTP200Aliases(list() as string)
Function:
A linked list of aliases to be treated as valid HTTP 200 responses.
Notes:
Some servers respond with a custom header response line. For example, IceCast servers respond with "ICY 200 OK". By including this string in your list of aliases, the response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK".
The alias itself is not parsed for any version strings. So if your alias is "MYHTTP/9.9", LibCURL will not treat the server as responding with HTTP version 9.9. Instead LibCURL will use the value set by option HTTPVersion.
The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
Some servers respond with a custom header response line. For example, IceCast servers respond with "ICY 200 OK". By including this string in your list of aliases, the response will be treated as a valid HTTP header line such as "HTTP/1.0 200 OK".
The alias itself is not parsed for any version strings. So if your alias is "MYHTTP/9.9", LibCURL will not treat the server as responding with HTTP version 9.9. Instead LibCURL will use the value set by option HTTPVersion.
The Lasterror property is set. 0 for success.
CURLNMBS.SetOptionHTTPHeader(list() as string)
Function:
A linked list of HTTP headers to pass to the server in your HTTP request.
Example:
Notes:
If you add a header that is otherwise generated and used by libCURL internally, your added one will be used instead. If you add a header with no contents as in 'Accept:' (no data on the right side of the colon), the internally used header will get disabled. Thus, using this option you can add new headers, replace internal headers and remove internal headers. To add a header with no contents, make the contents be two quotes: "". The headers included in the linked list must not be CRLF-terminated, because CURL adds CRLF after each header item. Failure to comply with this will result in strange bugs because the server will most likely ignore part of the headers you specified.
The first line in a request (containing the method, usually a GET or POST) is not a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers will only cause your request to send an invalid header.
Pass an empty array to this to reset back to no custom headers.
The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Example:
dim c as new CURLNMBS
c.SetOptionHTTPHeader array("Expect:", "Content-Type: text/xml", "SOAPAction: ""login""")
If you add a header that is otherwise generated and used by libCURL internally, your added one will be used instead. If you add a header with no contents as in 'Accept:' (no data on the right side of the colon), the internally used header will get disabled. Thus, using this option you can add new headers, replace internal headers and remove internal headers. To add a header with no contents, make the contents be two quotes: "". The headers included in the linked list must not be CRLF-terminated, because CURL adds CRLF after each header item. Failure to comply with this will result in strange bugs because the server will most likely ignore part of the headers you specified.
The first line in a request (containing the method, usually a GET or POST) is not a header and cannot be replaced using this option. Only the lines following the request-line are headers. Adding this method line in this list of headers will only cause your request to send an invalid header.
Pass an empty array to this to reset back to no custom headers.
The Lasterror property is set. 0 for success.
CURLNMBS.SetOptionMailRecipients(list() as string)
Function:
Sets the array of email recipient addresses.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 11.0 | Yes | Yes | Yes | Yes | No |
CURLNMBS.SetOptionPostQuote(list() as string)
Function:
Pass an array to a list of FTP commands to pass to the server after your ftp transfer request.
Example:
Notes:
Disable this operation again by using an empty array for this option.
The Lasterror property is set. 0 for success.
If you want to do a ftp operation instead of download/upload/directory listing, please use SetOptionQuote.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Example:
dim d as CURLNMBS // your CURL object
dim ws() As String
ws.Append "RNFR Temp.txt"
ws.append "RNTO MyFile.txt"
d.SetOptionPostQuote(ws)
Disable this operation again by using an empty array for this option.
The Lasterror property is set. 0 for success.
If you want to do a ftp operation instead of download/upload/directory listing, please use SetOptionQuote.
CURLNMBS.SetOptionPreQuote(list() as string)
Function:
Pass an array to a list of FTP commands to pass to the server after the transfer type is set.
Notes:
Disable this operation again by using an empty array for this option. Before version 7.15.6, if you also set Nobody to true, this option didn't work.
The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
Disable this operation again by using an empty array for this option. Before version 7.15.6, if you also set Nobody to true, this option didn't work.
The Lasterror property is set. 0 for success.
CURLNMBS.SetOptionProxyHeader(list() as string)
Function:
Set list of headers used for proxy requests only.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 18.2 | Yes | Yes | Yes | Yes | No |
CURLNMBS.SetOptionQuote(list() as string)
Function:
Pass an array or a list of FTP commands to pass to the server prior to your ftp request.
Example:
Notes:
This will be done before any other FTP commands are issued (even before the CWD command).
Disable this operation again by using an empty array for this option.
The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Example:
dim curl as new CURLNMBS
curl.SetOptionQuote array("DELE filename.txt")
This will be done before any other FTP commands are issued (even before the CWD command).
Disable this operation again by using an empty array for this option.
The Lasterror property is set. 0 for success.
CURLNMBS.SetOptionResolve(list() as string)
Function:
Send linked-list of name:port:address sets.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 18.2 | Yes | Yes | Yes | Yes | No |
CURLNMBS.SetOptionTelnetOptions(list() as string)
Function:
Provide an array of variables to pass to the telnet negotiations.
Notes:
The variables should be in the format <option=value>. libCURL supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET standard for details.
The Lasterror property is set. 0 for success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 9.8 | Yes | Yes | Yes | Yes | No |
Notes:
The variables should be in the format <option=value>. libCURL supports the options 'TTYPE', 'XDISPLOC' and 'NEW_ENV'. See the TELNET standard for details.
The Lasterror property is set. 0 for success.
CURLNMBS.SetPathCAInfo(path as folderitem)
Function:
A path holding one or more certificates to verify the peer with.
Example:
Notes:
This makes sense only when used in combination with the OptionSSLVerifyPeer option. If OptionSSLVerifyPeer is false, OptionCAINFO need not even indicate an accessible file.
Note that option is by default set to the system path where libCURL's cacert bundle is assumed to be stored, as established at build time.
The Lasterror property is set. 0 for success.
You can set this value and later you can read it, but you cannot read the default value.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Example:
dim cacert as FolderItem // your cacert.pem file
dim CURL as new CURLMBS
CURL.OptionSSLVerifyHost = 2 // verify server
CURL.OptionSSLVerifyPeer = 1 // proofs certificate is authentic
CURL.SetPathCAInfo cacert
This makes sense only when used in combination with the OptionSSLVerifyPeer option. If OptionSSLVerifyPeer is false, OptionCAINFO need not even indicate an accessible file.
Note that option is by default set to the system path where libCURL's cacert bundle is assumed to be stored, as established at build time.
The Lasterror property is set. 0 for success.
You can set this value and later you can read it, but you cannot read the default value.
CURLNMBS.SetPathCAPath(path as folderitem)
Function:
A path to the directory holding multiple CA certificates to verify the peer with.
Notes:
The certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option. If OptionSSLVerifyPeer is zero, OptionCAPath need not even indicate an accessible path. The OptionCAPath function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libCURL is built to use GnuTLS.
The Lasterror property is set. 0 for success.
You can set this value and later you can read it, but you cannot read the default value.
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
method | CURL | MBS CURL Plugin | 10.0 | Yes | Yes | Yes | Yes | No |
Notes:
The certificate directory must be prepared using the openssl c_rehash utility. This makes sense only when used in combination with the CURLOPT_SSL_VERIFYPEER option. If OptionSSLVerifyPeer is zero, OptionCAPath need not even indicate an accessible path. The OptionCAPath function apparently does not work in Windows due to some limitation in openssl. This option is OpenSSL-specific and does nothing if libCURL is built to use GnuTLS.
The Lasterror property is set. 0 for success.
You can set this value and later you can read it, but you cannot read the default value.
The items on this page are in the following plugins: MBS CURL Plugin.
Links
MBS Xojo Plugins