format update

This commit is contained in:
Daniel Stenberg
2004-10-25 11:05:37 +00:00
parent beb61ef429
commit 34089c93bb

View File

@@ -35,28 +35,28 @@ is made for file upload, there are also a stored CONTENT-TYPE and a
FILENAME. Below here, we'll discuss on what options you use to set these FILENAME. Below here, we'll discuss on what options you use to set these
properties in the parts you want to add to your post. properties in the parts you want to add to your post.
.SH OPTIONS .SH OPTIONS
.B CURLFORM_COPYNAME .IP CURLFORM_COPYNAME
followed by string is used to set the name of this part. libcurl copies the followed by string is used to set the name of this part. libcurl copies the
given data, so your application doesn't need to keep it around after this given data, so your application doesn't need to keep it around after this
function call. If the name isn't zero terminated properly, or if you'd like it function call. If the name isn't zero terminated properly, or if you'd like it
to contain zero bytes, you need to set the length of the name with to contain zero bytes, you need to set the length of the name with
\fBCURLFORM_NAMELENGTH\fP. \fBCURLFORM_NAMELENGTH\fP.
.B CURLFORM_PTRNAME .IP CURLFORM_PTRNAME
followed by a string is used for the name of this part. libcurl will use the followed by a string is used for the name of this part. libcurl will use the
pointer and refer to the data in your application, you must make sure it pointer and refer to the data in your application, you must make sure it
remains until curl no longer needs it. If the name isn't zero terminated remains until curl no longer needs it. If the name isn't zero terminated
properly, or if you'd like it to contain zero bytes, you need to set the properly, or if you'd like it to contain zero bytes, you need to set the
length of the name with \fBCURLFORM_NAMELENGTH\fP. length of the name with \fBCURLFORM_NAMELENGTH\fP.
.B CURLFORM_COPYCONTENTS .IP CURLFORM_COPYCONTENTS
followed by a string is used for the contents of this part, the actual data to followed by a string is used for the contents of this part, the actual data to
send away. libcurl copies the given data, so your application doesn't need to send away. libcurl copies the given data, so your application doesn't need to
keep it around after this function call. If the data isn't zero terminated keep it around after this function call. If the data isn't zero terminated
properly, or if you'd like it to contain zero bytes, you need to set the properly, or if you'd like it to contain zero bytes, you need to set the
length of the name with \fBCURLFORM_CONTENTSLENGTH\fP. length of the name with \fBCURLFORM_CONTENTSLENGTH\fP.
.B CURLFORM_PTRCONTENTS .IP CURLFORM_PTRCONTENTS
followed by a string is used for the contents of this part, the actual data to followed by a string is used for the contents of this part, the actual data to
send away. libcurl will use the pointer and refer to the data in your send away. libcurl will use the pointer and refer to the data in your
application, you must make sure it remains until curl no longer needs it. If application, you must make sure it remains until curl no longer needs it. If
@@ -64,11 +64,14 @@ the data isn't zero terminated properly, or if you'd like it to contain zero
bytes, you need to set the length of the name with bytes, you need to set the length of the name with
\fBCURLFORM_CONTENTSLENGTH\fP. \fBCURLFORM_CONTENTSLENGTH\fP.
.B CURLFORM_FILECONTENT .IP CURLFORM_CONTENTSLENGTH
followed by a long setting the length of the contents.
.IP CURLFORM_FILECONTENT
followed by a file name, makes that file read and the contents will be used in followed by a file name, makes that file read and the contents will be used in
as data in this part. as data in this part.
.B CURLFORM_FILE .IP CURLFORM_FILE
followed by a file name, makes this part a file upload part. It sets the file followed by a file name, makes this part a file upload part. It sets the file
name field to the actual file name used here, it gets the contents of the file name field to the actual file name used here, it gets the contents of the file
and passes as data and sets the content-type if the given file match one of and passes as data and sets the content-type if the given file match one of
@@ -77,32 +80,33 @@ send one or more files in one part by providing multiple \fBCURLFORM_FILE\fP
arguments each followed by the filename (and each CURLFORM_FILE is allowed to arguments each followed by the filename (and each CURLFORM_FILE is allowed to
have a CURLFORM_CONTENTTYPE). have a CURLFORM_CONTENTTYPE).
.B CURLFORM_CONTENTTYPE .IP CURLFORM_CONTENTTYPE
followed by a pointer to a string with a content-type will make curl use this followed by a pointer to a string with a content-type will make curl use this
given content-type for this file upload part, possibly instead of an given content-type for this file upload part, possibly instead of an
internally chosen one. internally chosen one.
.B CURLFORM_FILENAME .IP CURLFORM_FILENAME
followed by a pointer to a string to a name, will make libcurl use the given followed by a pointer to a string to a name, will make libcurl use the given
name in the file upload part, instead of the actual file name given to name in the file upload part, instead of the actual file name given to
\fICURLFORM_FILE\fP. \fICURLFORM_FILE\fP.
.B BCURLFORM_BUFFER .IP BCURLFORM_BUFFER
followed by a string, tells libcurl that a buffer is to be used to upload data followed by a string, tells libcurl that a buffer is to be used to upload data
instead of using a file. The given string is used as the value of the file instead of using a file. The given string is used as the value of the file
name field in the content header. name field in the content header.
.B CURLFORM_BUFFERPTR .IP CURLFORM_BUFFERPTR
followed by a pointer to a data area, tells libcurl the address of the buffer followed by a pointer to a data area, tells libcurl the address of the buffer
containing data to upload (as indicated with \fICURLFORM_BUFFER\fP). The containing data to upload (as indicated with \fICURLFORM_BUFFER\fP). The
buffer containing this data must not be freed until after buffer containing this data must not be freed until after
\fIcurl_easy_cleanup(3)\fP is called. \fIcurl_easy_cleanup(3)\fP is called. You must also use
\fICURLFORM_BUFFERLENGTH\fP to set the length of the given buffer area.
.B CURLFORM_BUFFERLENGTH .IP CURLFORM_BUFFERLENGTH
followed by a long with the size of the \fICURLFORM_BUFFERPTR\fP data area, followed by a long with the size of the \fICURLFORM_BUFFERPTR\fP data area,
tells libcurl the length of the buffer to upload. tells libcurl the length of the buffer to upload.
.B CURLFORM_ARRAY .IP CURLFORM_ARRAY
Another possibility to send options to curl_formadd() is the Another possibility to send options to curl_formadd() is the
\fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as \fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
its value. Each curl_forms structure element has a CURLformoption and a char its value. Each curl_forms structure element has a CURLformoption and a char
@@ -110,7 +114,7 @@ pointer. The final element in the array must be a CURLFORM_END. All available
options can be used in an array, except the CURLFORM_ARRAY option itself! The options can be used in an array, except the CURLFORM_ARRAY option itself! The
last argument in such an array must always be \fBCURLFORM_END\fP. last argument in such an array must always be \fBCURLFORM_END\fP.
.B CURLFORM_CONTENTHEADER .IP CURLFORM_CONTENTHEADER
specifies extra headers for the form POST section. This takes a curl_slist specifies extra headers for the form POST section. This takes a curl_slist
prepared in the usual way using \fBcurl_slist_append\fP and appends the list prepared in the usual way using \fBcurl_slist_append\fP and appends the list
of headers to those libcurl automatically generates. The list must exist while of headers to those libcurl automatically generates. The list must exist while