-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.cURLSession.Perform
libcURL.cURLSession.Perform
Sub Perform(URL As String, ReadFrom As Readable, WriteTo As Writeable)
Sub Perform(URL As libcURL.URLParser, ReadFrom As Readable, WriteTo As Writeable)
Function Perform(URL As String, ReadFrom As Readable, WriteTo As Writeable) As Boolean
Function Perform(URL As libcURL.URLParser, ReadFrom As Readable, WriteTo As Writeable) As Boolean
Name | Type | Comment |
---|---|---|
URL |
String or URLParser
|
The RFC 3986 URI to operate upon. In libcurl 7.62.0 and newer, you may also pass an instance of URLParser. |
ReadFrom | Readable |
Uploaded data (if any) will be read from this object. |
WriteTo | Writeable |
Downloaded data (if any) will be written to this object. |
The synchronous version of this method returns True
on success. Check cURLClient.LastError if this method returns False
.
This method initiates a generic request against the specified URL
. Details such as the request method, headers, etc. must already have been set. Retrieval semantics will be inferred unless the transfer has been configured otherwise. Synchronous transfers are performed on the calling thread; asynchronous transfers run on the event loop/main thread.
If the URL
parameter is empty (""
) then the previous URL is reused; if there is no previous URL then the transfer will fail with error code CURLE_URL_MALFORMAT
(3). If the previous transfer involved any sort of redirection then the "previous URL" is the URL enclosed in the final redirect. In versions of this method that accept a URLParser
instead of a String
, the URL
parameter may not be a literal Nil
. The equivalent to an "empty" URL
in these versions is a Nil reference of type URLParser
(don't bother; just use the empty string version).
ReadFrom
and/or WriteTo
may be Nil
. Beware that the status of being Nil
has important implications for these streams:
- If
WriteTo
isNil
and data is received then this data will be buffered in memory, and may be retrieved by calling GetDownloadedData after the transfer completes. - If
ReadFrom
isNil
and data is requested then the transfer will fail with error codeCURLE_ABORTED_BY_CALLBACK
(42).
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.