Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

curlopt_postfieldsize(3) [mojave man page]

CURLOPT_POSTFIELDSIZE(3)				     curl_easy_setopt options					  CURLOPT_POSTFIELDSIZE(3)

NAME
CURLOPT_POSTFIELDSIZE - size of POST data pointed to SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTFIELDSIZE, long size); DESCRIPTION
If you want to post data to the server without having libcurl do a strlen() to measure the data size, this option must be used. When this option is used you can post fully binary data, which otherwise is likely to fail. If this size is set to -1, the library will use strlen() to get the size. If you post more than 2GB, use CURLOPT_POSTFIELDSIZE_LARGE(3). DEFAULT
-1 PROTOCOLS
HTTP EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { const char *data = "data to send"; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* size of the POST data */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(data)); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); curl_easy_perform(curl); } AVAILABILITY
Along with HTTP RETURN VALUE
Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. SEE ALSO
CURLOPT_POSTFIELDS(3), CURLOPT_POSTFIELDSIZE_LARGE(3), libcurl 7.54.0 February 03, 2016 CURLOPT_POSTFIELDSIZE(3)

Check Out this Related Man Page

CURLOPT_COPYPOSTFIELDS(3)				     curl_easy_setopt options					 CURLOPT_COPYPOSTFIELDS(3)

NAME
CURLOPT_COPYPOSTFIELDS - have libcurl copy data to POST SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COPYPOSTFIELDS, char *data); DESCRIPTION
Pass a char * as parameter, which should be the full data to post in a HTTP POST operation. It behaves as the CURLOPT_POSTFIELDS(3) option, but the original data is instead copied by the library, allowing the application to overwrite the original data after setting this option. Because data are copied, care must be taken when using this option in conjunction with CURLOPT_POSTFIELDSIZE(3) or CURLOPT_POSTFIELD- SIZE_LARGE(3): If the size has not been set prior to CURLOPT_COPYPOSTFIELDS(3), the data is assumed to be a zero terminated string; else the stored size informs the library about the byte count to copy. In any case, the size must not be changed after CURLOPT_COPYPOST- FIELDS(3), unless another CURLOPT_POSTFIELDS(3) or CURLOPT_COPYPOSTFIELDS(3) option is issued. DEFAULT
NULL PROTOCOLS
HTTP(S) EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { char local_buffer[1024]="data to send"; curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* size of the data to copy from the buffer and send in the request */ curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 12L); /* send data from the local stack */ curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, local_buffer); curl_easy_perform(curl); } AVAILABILITY
Added in 7.17.1 RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_POSTFIELDS(3), CURLOPT_POSTFIELDSIZE(3), libcurl 7.54.0 February 03, 2016 CURLOPT_COPYPOSTFIELDS(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

raid 0+1 +oracle getting slow data reads.

howdy, Issue: Slow db data access. Oracle 7.3.4 OS: Sol8 +current patches Hardware: Model: E3600 CPU: (4) 336 US-II Memory: 2048 Disks Arrays: (2) D1000 (each on its own io card) Drives: (5/per disk array)Cheetah 9LP Capacity:9.1 GB Speed:10000 rpm Average Read Time: 5.4ms FS:... (19 Replies)
Discussion started by: Optimus_P
19 Replies

2. UNIX for Dummies Questions & Answers

Isspace

Hey gurus.. I am still struggling with unix.. whats is the equivalent of isspace function in Unix shell scripting. I came across situation where a variable is a fixed lenth. And if it contains only spaces, then i should flag it as error. for eg.. vartemp=" " if isspace(vartemp)... (7 Replies)
Discussion started by: vipas
7 Replies

3. AIX

User unable to create a file over 2 GB's in size

Hello, this is my first post. I have a user who cannot create a file over 2 GB's in size eventhough the FS is large file enabled and I added a special stanza in /etc/security/limits to allow an unlimited file size for this particular user (user1 - see below). ibm:/home/root (4062)#cat... (7 Replies)
Discussion started by: AIXtexas
7 Replies

4. Programming

Can't create file bigger than 2GB with my application

Hi, I've created a simple application that is supposed to fill up a file with messages up to the size I pass as parameter. The problem is that once the file reaches the 2GB size, it stops growing. The flow of the application, for what is worth, is as follows: while ( bytes written <... (7 Replies)
Discussion started by: emitrax
7 Replies

5. Shell Programming and Scripting

sed, awk [TAG]$content[/TAG] How to get var in $content in textfile?

Hello, I got a Qstion. Im posting to a phpbb forum with bash and curl.. i have a text file with the following tags that i post to the forum: $var1 $var2 $var3 How can i with sed or awk put var content from shell script between the ... in the... (7 Replies)
Discussion started by: atmosroll
7 Replies

6. UNIX for Dummies Questions & Answers

Basic cURL help!

hi!! this is my first post!! our university student search has this form which uses POST method(the website is swd.bits-goa.ac.in/searchform1)..now i tried sending post data from cURL... curl -o this.html --data "name=rohan&id=&hostel=&room=&branch=&search=Search"... (9 Replies)
Discussion started by: slotlocker
9 Replies

7. Red Hat

Posting Multiple Files using cURL

Hi, I am currently in the process of creating a script that will use cURL to HTTP POST the contents of a file on the server. I am able to run the command; curl -d @/path/to/file/filename.dat "https://posting.server.com/test.aspx"to post a single file and this works as expected. The... (4 Replies)
Discussion started by: MarkPaxo
4 Replies

8. Shell Programming and Scripting

CURL Button Click Issue

I am trying to perform a button click via cURL and I am having an issue possibly due to java script on click. The HTML source code is: <input id="ctl00_SPWebPartManager1_g_1bb6dc86_55ab_4ea9_a4db_4747922a8202_ctl00_RequestOption_0" class="radio" type="radio" checked="checked" value="1"... (5 Replies)
Discussion started by: js0505
5 Replies

9. Shell Programming and Scripting

I need to appears as different ip address when I send a form

Hi my problem is that I need to send a form to a web address using curl, from a unix shell, the web address on the receiving end will only accept incoming data from a specific ip address, and port, on another machine on our intranet, and I can not run curl on that machine. Is there any way I... (5 Replies)
Discussion started by: Paul Walker
5 Replies

10. Shell Programming and Scripting

awk processing of variable number of fields data file

Hy! I need to post-process some data files which have variable (and periodic) number of fields. For example, I need to square (data -> data*data) the folowing data file: -5.34281E-28 -3.69822E-29 8.19128E-29 9.55444E-29 8.16494E-29 6.23125E-29 4.42106E-29 2.94592E-29 1.84841E-29 ... (5 Replies)
Discussion started by: radudownload
5 Replies

11. Shell Programming and Scripting

How to specify a port with curl?

HI Im trying to use curl to send a xml file and im trying to send it over a specific port poes anyone know how to specify a port with curl? the command im using is C:\curl -X POST -d @C:\myfile.xml http://yourAddress.com/XMLInterface.asp (5 Replies)
Discussion started by: Paul Walker
5 Replies

12. Post Here to Contact Site Administrators and Moderators

Need urgent deletion of post..

Hi, I am sorry for asking a help, i want all my post and the results to be deleted urgently , for your knowledge base i can post a new with some demo server names I would be very thankful if this can be done as i am under some work pressure. (4 Replies)
Discussion started by: Varun Gera
4 Replies

13. Post Here to Contact Site Administrators and Moderators

Please remove the sensitive data from post

Hi Sir , Please remove the following code from the post https://www.unix.com/unix-for-advanced-and-expert-users/210081-ftp-issue.html thanks Prabhu (7 Replies)
Discussion started by: ptappeta
7 Replies

14. Shell Programming and Scripting

Curl/http 503 error with bash script

I am trying to use REST API and curl in a bash script to generate a http report. The curl command at the end of the script should generate a html file but instead I get an error "HTTP/1.1 503 Service Unavailable". This is the script #!/bin/bash export... (7 Replies)
Discussion started by: kieranfoley
7 Replies

15. AIX

Curl, to send text message

hello friends I need to send a text message MSM by AIX with a function called CURL you have some example of how it is done so that you can help me please (4 Replies)
Discussion started by: tricampeon81
4 Replies