libcURL.cURLClient.Put - charonn0/RB-libcURL GitHub Wiki
libcURL.cURLClient.Put
Method Signatures
Function Put(URL As String, Data As MemoryBlock, WriteTo As Writeable = Nil) As Boolean
Function Put(URL As String, ReadFrom As Readable, WriteTo As Writeable = Nil) As Boolean
Function Put(URL As libcURL.URLParser, Data As MemoryBlock, WriteTo As Writeable = Nil) As Boolean
Function Put(URL As libcURL.URLParser, ReadFrom As Readable, WriteTo As Writeable = Nil) As Boolean
Sub Put(URL As String, Data As MemoryBlock, WriteTo As Writeable = Nil)
Sub Put(URL As String, ReadFrom As Readable, WriteTo As Writeable = Nil)
Sub Put(URL As libcURL.URLParser, Data As MemoryBlock, WriteTo As Writeable = Nil)
Sub Put(URL As libcURL.URLParser, ReadFrom As Readable, WriteTo As Writeable = Nil)
Parameters
Put(String, MemoryBlock, Writeable)
| Name | Type | Comment |
|---|---|---|
| URL | String or URLParser |
The RFC 3986 URI to put. In libcurl 7.62.0 and newer, you may also pass an instance of URLParser. |
| Data | MemoryBlock |
A MemoryBlock containing the entire upload. |
| WriteTo | Writeable |
Optional. Downloaded data (if any) will be written to this object. If this parameter is Nil then use GetDownloadedData. |
Put(String, Readable, Writeable)
| Name | Type | Comment |
|---|---|---|
| URL | String or URLParser |
The RFC 3986 URI to put. In libcurl 7.62.0 and newer, you may also pass an instance of URLParser. |
| ReadFrom | Readable |
Uploaded data will be read from this object. |
| WriteTo | Writeable |
Optional. Downloaded data (if any) will be written to this object. If this parameter is Nil then use GetDownloadedData. |
Return value
The synchronous versions of this method return True on success. Check cURLClient.LastError if this method returns False.
Remarks
Upload the stream represented by ReadFrom or the data represented by Data using protocol-appropriate semantics (http PUT, ftp STOR, etc.)
The protocol is inferred by libcURL; explicitly specify the protocol in the URL to avoid bad guesses.
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.