CURLOPT_CURLU.3 2.4 KB

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