libcurl-easy.3 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .TH libcurl 3 "19 Sep 2014" "libcurl" "libcurl"
  25. .SH NAME
  26. libcurl-easy \- easy interface overview
  27. .SH DESCRIPTION
  28. When using libcurl's "easy" interface you init your session and get a handle
  29. (often referred to as an "easy handle"), which you use as input to the easy
  30. interface functions you use. Use \fIcurl_easy_init(3)\fP to get the handle.
  31. You continue by setting all the options you want in the upcoming transfer, the
  32. most important among them is the URL itself (you cannot transfer anything
  33. without a specified URL as you may have figured out yourself). You might want
  34. to set some callbacks as well that will be called from the library when data
  35. is available etc. \fIcurl_easy_setopt(3)\fP is used for all this.
  36. \fICURLOPT_URL(3)\fP is the only option you really must set, as otherwise
  37. there can be no transfer. Another commonly used option is
  38. \fICURLOPT_VERBOSE(3)\fP that will help you see what libcurl is doing under
  39. the hood, which is useful when debugging for example. The
  40. \fIcurl_easy_setopt(3)\fP man page has a full index of the almost 300
  41. available options.
  42. If you at any point would like to blank all previously set options for a
  43. single easy handle, you can call \fIcurl_easy_reset(3)\fP and you can also
  44. make a clone of an easy handle (with all its set options) using
  45. \fIcurl_easy_duphandle(3)\fP.
  46. When all is setup, you tell libcurl to perform the transfer using
  47. \fIcurl_easy_perform(3)\fP. It will then do the entire operation and will not
  48. return until it is done (successfully or not).
  49. After the transfer has been made, you can set new options and make another
  50. transfer, or if you are done, cleanup the session by calling
  51. \fIcurl_easy_cleanup(3)\fP. If you want persistent connections, you do not
  52. cleanup immediately, but instead run ahead and perform other transfers using
  53. the same easy handle.
  54. .SH "SEE ALSO"
  55. .BR curl_easy_init "(3)," curl_easy_cleanup "(3)," curl_easy_setopt "(3), "
  56. .BR libcurl-errors "(3), " libcurl-multi "(3), " libcurl "(3) "