The roUrlTransfer component sends the roUrlEvent with the following methods:

GetInt() as Integer

Returns the type of event. The following event types are currently defined:

1transfer complete
2

transfer started. Headers are available for suitable protocols. (Not currently implemented)

GetResponseCode() as Integer

Returns the protocol response code associated with this event. For a successful HTTP request this will be the HTTP status code 200.

For unexpected errors the return value is negative. There are lots of possible negative errors from the CURL library but it's often best just to look at the text version via GetFailureReason().

Here are some potential errors. Not all of them can be generated.

Status

Name

Description

-1

CURLE_UNSUPPORTED_PROTOCOL

 

-2

CURLE_FAILED_INIT

 

-3

CURLE_URL_MALFORMAT

 

-5

CURLE_COULDNT_RESOLVE_PROXY

 

-6

CURLE_COULDNT_RESOLVE_HOST

 

-7

CURLE_COULDNT_CONNECT

 

-8

CURLE_FTP_WEIRD_SERVER_REPLY

 

-9

CURLE_REMOTE_ACCESS_DENIED

a service was denied by the server due to lack of access - when login fails this is not returned.

-11

CURLE_FTP_WEIRD_PASS_REPLY

 

-13

CURLE_FTP_WEIRD_PASV_REPLY

 

-14

CURLE_FTP_WEIRD_227_FORMAT

 

-15

CURLE_FTP_CANT_GET_HOST

 

-17

CURLE_FTP_COULDNT_SET_TYPE

 

-18

CURLE_PARTIAL_FILE

 

-19

CURLE_FTP_COULDNT_RETR_FILE

 

-21

CURLE_QUOTE_ERROR

quote command failure

-22

CURLE_HTTP_RETURNED_ERROR

 

-23

CURLE_WRITE_ERROR

 

-25

CURLE_UPLOAD_FAILED

failed upload "command"

-26

CURLE_READ_ERROR

could open/read from file

-27

CURLE_OUT_OF_MEMORY

 

-28

CURLE_OPERATION_TIMEDOUT

the timeout time was reached

-30

CURLE_FTP_PORT_FAILED

FTP PORT operation failed

-31

CURLE_FTP_COULDNT_USE_REST

the REST command failed

-33

CURLE_RANGE_ERROR

RANGE "command" didn't work

-34

CURLE_HTTP_POST_ERROR

 

-35

CURLE_SSL_CONNECT_ERROR

wrong when connecting with SSL

-36

CURLE_BAD_DOWNLOAD_RESUME

couldn't resume download

-37

CURLE_FILE_COULDNT_READ_FILE

 

-38

CURLE_LDAP_CANNOT_BIND

 

-39

CURLE_LDAP_SEARCH_FAILED

 

-41

CURLE_FUNCTION_NOT_FOUND

 

-42

CURLE_ABORTED_BY_CALLBACK

 

-43

CURLE_BAD_FUNCTION_ARGUMENT

 

-45

CURLE_INTERFACE_FAILED

CURLOPT_INTERFACE failed

-47

CURLE_TOO_MANY_REDIRECTS

catch endless re-direct loops

-48

CURLE_UNKNOWN_TELNET_OPTION

User specified an unknown option

-49

CURLE_TELNET_OPTION_SYNTAX

Malformed telnet option

-51

CURLE_PEER_FAILED_VERIFICATION

peer's certificate or fingerprint wasn't verified fine

-52

CURLE_GOT_NOTHING

when this is a specific error

-53

CURLE_SSL_ENGINE_NOTFOUND

SSL crypto engine not found

-54

CURLE_SSL_ENGINE_SETFAILED

can not set SSL crypto engine as default

-55

CURLE_SEND_ERROR,

failed sending network data

-56

CURLE_RECV_ERROR

failure in receiving network data

-58

CURLE_SSL_CERTPROBLEM

problem with the local certificate

-59

CURLE_SSL_CIPHER

couldn't use specified cipher

-60

CURLE_SSL_CACERT

problem with the CA cert (path?)

-61

CURLE_BAD_CONTENT_ENCODING

Unrecognized transfer encoding

-62

CURLE_LDAP_INVALID_URL

Invalid LDAP URL

-63

CURLE_FILESIZE_EXCEEDED,

Maximum file size exceeded

-64

CURLE_USE_SSL_FAILED,

Requested FTP SSL level failed

-65

CURLE_SEND_FAIL_REWIND,

Sending the data requires a rewind that failed

-66

CURLE_SSL_ENGINE_INITFAILED

failed to initialise ENGINE

-67

CURLE_LOGIN_DENIED

user, password or similar was not accepted and we failed to login

-68

CURLE_TFTP_NOTFOUND

file not found on server

-69

CURLE_TFTP_PERM

permission problem on server

-70

CURLE_REMOTE_DISK_FULL

out of disk space on server

-71

CURLE_TFTP_ILLEGAL

Illegal TFTP operation

-72

CURLE_TFTP_UNKNOWNID

Unknown transfer ID

-73

CURLE_REMOTE_FILE_EXISTS

File already exists

-74

CURLE_TFTP_NOSUCHUSER

No such user

-75

CURLE_CONV_FAILED

conversion failed

-76

CURLE_CONV_REQD

caller must register conversion callbacks using curl_easy_setopt options CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and CURLOPT_CONV_FROM_UTF8_FUNCTION

-77

CURLE_SSL_CACERT_BADFILE

could not load CACERT file, missing or wrong format

-78

CURLE_REMOTE_FILE_NOT_FOUND

remote file not found

-79

CURLE_SSH

error from the SSH layer, somewhat generic so the error message will be of interest when this has happened

-80

CURLE_SSL_SHUTDOWN_FAILED

Failed to shut down the SSL connection

GetFailureReason() as String

Returns a description of the failure that occurred.

GetString() as String

Return the string associated with the event. For transfer complete AsyncGetToString, AsyncPostFromString and AsyncPostFromFile requests this will be the actual response body from the server.

GetSourceIdentity() as Integer

Returns a magic number that can be matched with the value returned by roUrlTransfer.GetIdentity() to determine which roUrlTransfer this event came from.

GetResponseHeaders() as Object

Returns an roAssociativeArray containing all the headers returned by the server for appropriate protocols (such as HTTP).

Headers are only returned when the status code is greater than or equal to 200 and less than 300.

GetTargetIpAddress() as String

Returns the IP address of the destination. 

GetResponseHeadersArray() as Object

Returns an roArray of roAssociativeArrays. Each associative array contains a single header name/value pair. Use this function if you need access to duplicate headers, since GetResponseHeaders() returns only the last name/value pair for a given name. All headers are returned regardless of the status code.

 

Attachments:

roUrlEvent.url (application/octet-stream)
roUrlEvent.url (application/octet-stream)