curl_url_strerror.md (949B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: curl_url_strerror 5 Section: 3 6 Source: libcurl 7 See-also: 8 - curl_easy_strerror (3) 9 - curl_multi_strerror (3) 10 - curl_share_strerror (3) 11 - curl_url_get (3) 12 - curl_url_set (3) 13 - libcurl-errors (3) 14 Protocol: 15 - All 16 Added-in: 7.80.0 17 --- 18 19 # NAME 20 21 curl_url_strerror - return string describing error code 22 23 # SYNOPSIS 24 25 ~~~c 26 #include <curl/curl.h> 27 28 const char *curl_url_strerror(CURLUcode errornum); 29 ~~~ 30 31 # DESCRIPTION 32 33 This function returns a string describing the CURLUcode error code passed in 34 the argument *errornum*. 35 36 # %PROTOCOLS% 37 38 # EXAMPLE 39 40 ~~~c 41 int main(void) 42 { 43 CURLUcode rc; 44 CURLU *url = curl_url(); 45 rc = curl_url_set(url, CURLUPART_URL, "https://example.com", 0); 46 if(rc) 47 printf("URL error: %s\n", curl_url_strerror(rc)); 48 curl_url_cleanup(url); 49 } 50 ~~~ 51 52 # %AVAILABILITY% 53 54 # RETURN VALUE 55 56 A pointer to a null-terminated string.