CURLOPT_CURLU.3 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 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. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_CURLU 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_CURLU \- URL in URL handle format
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CURLU, void *pointer);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass in a pointer to the \fIURL\fP to work with. The parameter should be a
  35. \fICURLU *\fP. Setting \fICURLOPT_CURLU(3)\fP will explicitly override
  36. \fICURLOPT_URL(3)\fP.
  37. \fICURLOPT_URL(3)\fP or \fICURLOPT_CURLU(3)\fP \fBmust\fP be set before a
  38. transfer is started.
  39. libcurl will use this handle and its contents read-only and will not change
  40. its contents. An application can update the contents of the URL handle after a
  41. transfer is done and if the same handle is then used in a subsequent request
  42. the updated contents will then be used.
  43. .SH DEFAULT
  44. The default value of this parameter is NULL.
  45. .SH PROTOCOLS
  46. All
  47. .SH EXAMPLE
  48. .nf
  49. CURL *handle = curl_easy_init();
  50. CURLU *urlp = curl_url();
  51. int res = 0;
  52. if(curl) {
  53. res = curl_url_set(urlp, CURLUPART_URL, "https://example.com", 0);
  54. curl_easy_setopt(handle, CURLOPT_CURLU, urlp);
  55. ret = curl_easy_perform(handle);
  56. curl_url_cleanup(urlp);
  57. curl_easy_cleanup(handle);
  58. }
  59. .fi
  60. .SH AVAILABILITY
  61. Added in 7.63.0.
  62. .SH RETURN VALUE
  63. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  64. .SH "SEE ALSO"
  65. .BR CURLOPT_URL "(3), "
  66. .BR curl_url "(3), " curl_url_get "(3), " curl_url_set "(3), "
  67. .BR curl_url_dup "(3), " curl_url_cleanup "(3), " curl_url_strerror "(3)"