Method HttpClient():getFile() Foundation

Sends a request and writes the reponse to a file.

Syntax
 
:getFile( <cFileName> ) --> self
Parameters
<cFileName>
A character string with the name and the path of the local file.
Return

:getFile() returns the object executing the method.

Description

Similar to the :send() method, :getFile() sends a request to the server. However, instead of returning the response as a binary string, :getFile() writes the response directly to the specified file. This allows downloading files of arbitrary size, for example.

After the method has returned and if the status code does not indicate success (200) nothing was written to the file specified. In this case the response content can be retrieved by the :getContent() method of the response object assigned to the :HttpResponse member variable.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.