CURLOPT_CURLU.3 2.5 KB

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