Skip to content

libcURL.EasyHandle.SetOption

Andrew Lambert edited this page Nov 26, 2022 · 22 revisions

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 remarks) 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.

Remarks

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:

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.

See also

Clone this wiki locally