-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.EasyHandle.SetOption
libcURL.EasyHandle.SetOption
Function SetOption(OptionNumber As Integer, NewValue As Variant) As Boolean
Name | Type | Comment |
---|---|---|
OptionNumber | Integer | A cURL option number |
NewValue | Variant (see remarks) | The new value for the option |
If the option was set this method returns True
. If it returns False
the option was not set and the curl error number is stored in EasyHandle.LastError.
Call this method with a curl option number and a value that is acceptable for that option. SetOption
does not check that a value is valid for a particular option (except Nil,) however it does enforce type safety of the value and will raise an exception if an unsupported type is passed.
NewValue
may be of one of the following datatypes:
-
Nil
(if explicitly permitted for theOptionNumber
) Boolean
Integer
Ptr
String
MemoryBlock
FolderItem
MultipartForm
MIMEMessage
ListPtr
ShareHandle
- A Delegate matching
cURLIOCallback
,cURLDebugCallback
,cURLSeekCallback
,cURLProgressCallback
, orcURLInitRequestCallback
These datatypes will be automatically marshaled into a Ptr
before being passed to libcURL.
Setting an option value to an unsupported type will raise a TypeMismatchException.
Setting an option that does not allow NULL
to Nil
will raise a NilObjectException.
Use EasyHandle.SetOptionPtr to bypass automatic marshaling.
- EasyHandle.SetOptionPtr
- EasyHandle.Perform
- EasyHandle.GetOption
- libcURL.Opts module containing option number constants
- OptionInfo class
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.