BE_HTTP_GET ( url {; filename ; username ; password } )

Does a http GET function and returns the results. This uses the curl library so output will be similar to that. This is used in conjunction with the BE_HTTP_SetCustomHeader function to set custom headers in advance and the BE_HTTP_ResponseCode and BE_HTTP_ResponseHeaders functions to get the result values after the GET is complete.

Version : 1.2
Version : 3.3.0 Renamed to BE_HTTP_GET from BE_GetURL 

Parameters :
url : the url to retrieve.
filename ( optional ) : Required if you're saving the contents of the url ( i.e. text or a file ) into a container field. The container field uses the name supplied here for the name of the resulting file.
username ( optional ) : The username if the url requires authentication.
password ( optional ) : The password if the url requires authentication.

Result : The result values from the url.

Check for errors using the BE_GetLastError function and use for error details.

Some useful header options :

BE_CurlSetOption ( "CURLOPT_FOLLOWLOCATION" ; 1 ) will mean that it will follow a 301 redirect.

BE_CurlSetOption ( "CURLOPT_HTTPAUTH" ; 1 ) forces Basic auth for some sites that won't work with the defaults.

This function can also be used for FTP by using ftp:// urls.  For example :

BE_HTTP_GET ( "sftp://server/path/file.txt" ; "" ; ; )


BE_CurlSetOption ( "CURLOPT_DIRLISTONLY" ; 1 )

BE_HTTP_GET ( "sftp://server/path/" ; "" ; ; )

to get a file listing at that path.


Still need help? Contact Us Contact Us