2
0

CURLOPT_DEFAULT_PROTOCOL.3 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_DEFAULT_PROTOCOL 3 "18 Aug 2015" "libcurl 7.45.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_DEFAULT_PROTOCOL \- default protocol to use if the URL is missing a
  26. scheme name
  27. .SH SYNOPSIS
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DEFAULT_PROTOCOL, char
  30. *protocol);
  31. .SH DESCRIPTION
  32. This option tells libcurl to use \fIprotocol\fP if the URL is missing a scheme
  33. name.
  34. Use one of these protocol (scheme) names:
  35. dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3,
  36. pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
  37. An unknown or unsupported protocol causes error
  38. \fICURLE_UNSUPPORTED_PROTOCOL\fP when libcurl parses a schemeless URL. Parsing
  39. happens when \fIcurl_easy_perform(3)\fP or \fIcurl_multi_perform(3)\fP is
  40. called. The protocols supported by libcurl will vary depending on how it was
  41. built. Use \fIcurl_version_info(3)\fP if you need a list of protocol names
  42. supported by the build of libcurl that you are using.
  43. This option does not change the default proxy protocol (http).
  44. Without this option libcurl would make a guess based on the host, see
  45. \fICURLOPT_URL(3)\fP for details.
  46. The application does not have to keep the string around after setting this
  47. option.
  48. .SH DEFAULT
  49. NULL (make a guess based on the host)
  50. .SH PROTOCOLS
  51. All
  52. .SH EXAMPLE
  53. .nf
  54. curl = curl_easy_init();
  55. if(curl) {
  56. /* set a URL without a scheme */
  57. curl_easy_setopt(curl, CURLOPT_URL, "example.com");
  58. /* set the default protocol (scheme) for schemeless URLs */
  59. curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
  60. /* Perform the request */
  61. curl_easy_perform(curl);
  62. }
  63. .fi
  64. .SH AVAILABILITY
  65. Added in 7.45.0
  66. .SH RETURN VALUE
  67. CURLE_OK if the option is supported.
  68. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  69. CURLE_UNKNOWN_OPTION if the option is not supported.
  70. .SH "SEE ALSO"
  71. .BR CURLOPT_URL "(3), "