CURLOPT_PUT.3 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_PUT 3 "17 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_PUT \- make an HTTP PUT request
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PUT, long put);
  32. .fi
  33. .SH DESCRIPTION
  34. A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
  35. data should be set with \fICURLOPT_READDATA(3)\fP and
  36. \fICURLOPT_INFILESIZE(3)\fP.
  37. This option is \fBdeprecated\fP since version 7.12.1. Use
  38. \fICURLOPT_UPLOAD(3)\fP!
  39. .SH DEFAULT
  40. 0, disabled
  41. .SH PROTOCOLS
  42. HTTP
  43. .SH EXAMPLE
  44. .nf
  45. CURL *curl = curl_easy_init();
  46. if(curl) {
  47. /* we want to use our own read function */
  48. curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
  49. /* enable PUT */
  50. curl_easy_setopt(curl, CURLOPT_PUT, 1L);
  51. /* specify target */
  52. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");
  53. /* now specify which pointer to pass to our callback */
  54. curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
  55. /* Set the size of the file to upload */
  56. curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize);
  57. /* Now run off and do what you have been told! */
  58. curl_easy_perform(curl);
  59. }
  60. .fi
  61. .SH AVAILABILITY
  62. Deprecated since 7.12.1. Do not use.
  63. .SH RETURN VALUE
  64. Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
  65. .SH "SEE ALSO"
  66. .BR CURLOPT_UPLOAD "(3), " CURLOPT_HTTPGET "(3), "