CURLOPT_CURLU.3 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .\" generated by cd2nroff 0.1 from CURLOPT_CURLU.md
  2. .TH CURLOPT_CURLU 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_CURLU \- URL in URL handle format
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CURLU, CURLU *pointer);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass in a pointer to the \fIURL\fP handle to work with. The parameter should be a
  12. \fICURLU pointer\fP. Setting \fICURLOPT_CURLU(3)\fP explicitly overrides
  13. \fICURLOPT_URL(3)\fP.
  14. \fICURLOPT_URL(3)\fP or \fICURLOPT_CURLU(3)\fP \fBmust\fP be set before a
  15. transfer is started.
  16. libcurl uses this handle and its contents read\-only and does not change its
  17. contents. An application can update the contents of the URL handle after a
  18. transfer is done and if the same handle is used in a subsequent request the
  19. updated contents is used.
  20. .SH DEFAULT
  21. NULL
  22. .SH PROTOCOLS
  23. This functionality affects all supported protocols
  24. .SH EXAMPLE
  25. .nf
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. CURLU *urlp = curl_url();
  30. if(curl) {
  31. CURLcode res;
  32. CURLUcode ret;
  33. ret = curl_url_set(urlp, CURLUPART_URL, "https://example.com", 0);
  34. curl_easy_setopt(curl, CURLOPT_CURLU, urlp);
  35. res = curl_easy_perform(curl);
  36. curl_url_cleanup(urlp);
  37. curl_easy_cleanup(curl);
  38. }
  39. }
  40. .fi
  41. .SH AVAILABILITY
  42. Added in curl 7.63.0
  43. .SH RETURN VALUE
  44. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  45. .SH SEE ALSO
  46. .BR CURLOPT_URL (3),
  47. .BR curl_url (3),
  48. .BR curl_url_cleanup (3),
  49. .BR curl_url_dup (3),
  50. .BR curl_url_get (3),
  51. .BR curl_url_set (3),
  52. .BR curl_url_strerror (3)