-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.EasyHandle.SetOption
#libcURL.EasyHandle.SetOption
##Method Signature
Function SetOption(OptionNumber As Integer, NewValue As Variant) As Boolean
##Parameters
Name | Type | Comment |
---|---|---|
OptionNumber | Integer | A cURL option number |
NewValue | Variant (see notes) | The new value for the option |
##Return value
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.
##Notes
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 a Boolean
, Integer
, Ptr
, String
, MemoryBlock
, FolderItem
, libcURL.MultipartForm
, libcURL.ListPtr
, or libcURL.ShareHandle
; or, a Delegate matching cURLIOCallback
, cURLCloseCallback
, cURLDebugCallback
, cURLOpenCallback
, cURLProgressCallback
, or cURLSSLInitCallback
.
Passing a Nil
object as NewValue
will raise an exception unless the option explicitly accepts NULL
.
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 marshalling.
##See also
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.