Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
8ea5b5bb
Commit
8ea5b5bb
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
clarified and extended with an example
parent
0ce49cb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/curl_formparse.3
+29
-12
29 additions, 12 deletions
docs/curl_formparse.3
with
29 additions
and
12 deletions
docs/curl_formparse.3
+
29
−
12
View file @
8ea5b5bb
...
...
@@ -2,26 +2,31 @@
.\" nroff -man [file]
.\" Written by daniel@haxx.se
.\"
.TH curl_formparse 3 "
5 March
2001" "libcurl 7.
0
" "libcurl Manual"
.TH curl_formparse 3 "
23 April
2001" "libcurl 7.
7.2
" "libcurl Manual"
.SH NAME
curl_formparse - add a section to a multipart/formdata HTTP POST
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "CURLcode curl_formparse(char *" string, "struct HttpPost **" firstitem,
.BI "struct HttpPost ** "lastitem ");"
.BI "CURLcode curl_formparse(char *
" string, "
struct HttpPost **
" firstitem,
.BI "struct HttpPost ** "
lastitem ");"
.ad
.SH DESCRIPTION
curl_formparse() is used to append sections when building a multipart/formdata
HTTP POST. Append one section at a time until you've added all the sections
you want included and then you pass the
.I firstitem
pointer as parameter to CURLOPT_HTTPPOST.
.I lastitem
is set after each call and on repeated invokes it should be left as set to
allow repeated invokes to find the end of the list in a faster way.
.I string
must be a zero terminated string following the following syntax.
HTTP POST (sometimes refered to as rfc1867-style posts). Append one section at
a time until you've added all the sections you want included and then you pass
the \fI firstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP.
\fIlastitem\fP is set after each call and on repeated invokes it should be
left as set to allow repeated invokes to find the end of the list in a faster
way. \fIstring\fP must be a zero terminated string following the following
syntax.
The pointers \fIfirstitem\fP and \fIlastitem\fP point to, should both be
pointers to NULL in the first call to this function. All list-data will be
allocated by the function itself. You must call \fIcurl_formfree\fP after the
form has been done to free the resources again.
See example below.
.SH "FORM PARSE STRINGS"
The
.I string
...
...
@@ -55,6 +60,18 @@ content-type for all of them in the same way as with a single file.
.PP
.SH RETURN VALUE
Returns non-zero if an error occurs.
.SH EXAMPLE
HttpPost* post = NULL;
HttpPost* last = NULL;
/* Add an image section */
curl_formparse("picture=@my-face.jpg", &post, &last);
/* Add a normal text section */
curl_formparse("name=FooBar", &post, &last);
/* Set the form info */
curl_easy_setopt(curl, CURLOPT_HTTPPOST, &post);
.SH "SEE ALSO"
.BR curl_easy_setopt "(3) "
.SH BUGS
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment