.. highlightlang:: us .. index:: curl_easy_setopt .. _curl_easy_setopt: curl_easy_setopt ================ .. us.tag curl_easy_setopt NOTREADYENGLISH Curl New5700 :ref:`curl_easy_setopt` sets one or more options for a curl pointer. .. function:: error = curl_easy_setopt(curl, oOptions) error = curl_easy_setopt(curl, optionID, option) .. us.return **Return Value** *errCode* is 0, if the data transfer was successful or an error code. The error code description can be received calling :ref:`curl_easy_strerror`. *errCode* .. us.params **Parameters** .. uparam:: curl Is the curl pointer returned by :ref:`curl_easy_init`. .. uparam:: optionID *optionID* is the option Id, for example CURLOPT_URL (10023). .. uparam:: option *option* is the option value, a string, a number of an object, depending on *optionID*. .. uparam:: oOptions *oOptions* is an option object. .. list-table:: :header-rows: 1 * - Option - Data Type - Description * - CURLOPT_HTTPHEADER - String Vector - Extra Header Data. * - CURLOPT_HTTPPOST - String Vektor - *smFormData* is a string matrix with two columns or an empty String ``""``. The first column is the ``name`` element and the second column contains the ``value`` element. Example: An HTML page contains the following form::
*smFormData* can be specified as following:: smFormData = ["email", "info@uniplot.de"; "password", "xxxx"; "download", "Download"]; * - CURLOPT_URL - String - The URL, for example ``"http://www.uniplot.de"``. * - CURLOPT_WRITEFUNCTION - String - UniScript-Callback function name:: my_write_callback(data, user_obj) **data**: Is a UniScript string with data. **user_obj**: Ein Objekt (:ref:`obj_create`). :: def _curl_write_callback(data, user) { user.cnt = user.cnt + 1; user.data[user.cnt] = data; return 1; // return 0 to abort transfer } * - CURLOPT_WRITEDATA - Object - An Object (:ref:`obj_create`) passed as a parameter to the callback function. * - CURLOPT_READFUNCTION - String - UniScript-Read function name. * - CURLOPT_READDATA - Object - An object (:ref:`obj_create`) passed to the callback function. Example: The prefix ``CURLOPT_`` can be skipped and all names can be specified in lower case:: oOptions = [. ssl_verifyhost = FALSE, timeout = 5 /* sec. */]; A complete list of all options can be found here: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html. All options with the data type long, OFF_T values and char* values can be used. .. us.example **Example** See :ref:`curl_easy_init`. .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2015.0 - New. .. seealso:: :ref:`overview-curl`, :ref:`curl_easy_init` :sub:`id-266065`