CURLOPT_SERVICE_NAME.md (1501B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: CURLOPT_SERVICE_NAME 5 Section: 3 6 Source: libcurl 7 See-also: 8 - CURLOPT_PROXY (3) 9 - CURLOPT_PROXYTYPE (3) 10 - CURLOPT_PROXY_SERVICE_NAME (3) 11 Protocol: 12 - HTTP 13 - FTP 14 - IMAP 15 - POP3 16 - SMTP 17 - LDAP 18 Added-in: 7.43.0 19 --- 20 21 # NAME 22 23 CURLOPT_SERVICE_NAME - authentication service name 24 25 # SYNOPSIS 26 27 ~~~c 28 #include <curl/curl.h> 29 30 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SERVICE_NAME, char *name); 31 ~~~ 32 33 # DESCRIPTION 34 35 Pass a char pointer as parameter to a string holding the *name* of the service 36 for DIGEST-MD5, SPNEGO and Kerberos 5 authentication mechanisms. The default 37 service names are "ftp", "HTTP", "imap", "ldap", "pop" and "smtp". This option 38 allows you to change them. 39 40 The application does not have to keep the string around after setting this 41 option. 42 43 Using this option multiple times makes the last set string override the 44 previous ones. Set it to NULL to disable its use again. 45 46 # DEFAULT 47 48 See above 49 50 # %PROTOCOLS% 51 52 # EXAMPLE 53 54 ~~~c 55 int main(void) 56 { 57 CURL *curl = curl_easy_init(); 58 if(curl) { 59 CURLcode ret; 60 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); 61 curl_easy_setopt(curl, CURLOPT_SERVICE_NAME, "custom"); 62 ret = curl_easy_perform(curl); 63 } 64 } 65 ~~~ 66 67 # %AVAILABILITY% 68 69 # RETURN VALUE 70 71 curl_easy_setopt(3) returns a CURLcode indicating success or error. 72 73 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see 74 libcurl-errors(3).