We are trying to invoke a https service from our unix script using curl command. The service is not getting invoked because it is SSL configured. Bypassing certification (using curl –k) does not work.
curl -k https://site
curl -k -x IP:Port https://site
curl -k -x IP:443 https://id:pwd@site
... (0 Replies)
Hello,
I am wondering does anyone know of a method using curl/wget or other where by I could specify the IP address of the server I wish to query for a website.
Something similar to editing /etc/hosts but that can be done directly from the command line. I have looked through the man pages... (4 Replies)
Hi
I need a Shell script that will download a zip file every second from a http server but i can't use neither curl nor wget.
Can anyone will help me go about this task ???
Thanks!! (1 Reply)
Experts,
I login to a 3rd party and pull some valuable information with my credentials. I pass my credentials via --post-data in wget.
Now my Account is locked. I want my wget to alert that the Account is locked. How can i achieve this.
My idea is, get the Source page html from the... (2 Replies)
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.
My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled... (0 Replies)
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled it.... (12 Replies)
Hi All,
I am trying to post an xml file (utf-16 encoded) using curl to a REST service. The REST service is expecting 'multipart/form-data' content type.
curl -k -i -H "Content-Type=multipart/form-data" -F "filename=@file.xml;type=text/xml" -X POST -u <username>:<password> <endPointURL>
... (0 Replies)
how to make the bash script ?
http://server.com/mysql.php
POST /mysql.php HTTP/1.1
Host: server.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language:... (1 Reply)
HI All,
i want to asking about my case , how to post content file of data using curl.
currently if i wanna post data file , i can use this command below :
curl --cacert maxaj.cer -X POST -F 'fileupload=@/data/report_3300_xxx/log/traffic_3300_20180319_1051.txt'... (0 Replies)
What can I use instead of wget/curl when I need to log into websites that use javascript?
Wget and curl don't handle javascript. (6 Replies)
Discussion started by: locoroco
6 Replies
LEARN ABOUT MOJAVE
curlopt_postfields
CURLOPT_POSTFIELDS(3) curl_easy_setopt options CURLOPT_POSTFIELDS(3)NAME
CURLOPT_POSTFIELDS - specify data to POST to server
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_POSTFIELDS, char *postdata);
DESCRIPTION
Pass a char * as parameter, pointing to the full data to send in a HTTP POST operation. You must make sure that the data is formatted the
way you want the server to receive it. libcurl will not convert or encode it for you in any way. For example, the web server may assume
that this data is url-encoded.
The data pointed to is NOT copied by the library: as a consequence, it must be preserved by the calling application until the associated
transfer finishes. This behaviour can be changed (so libcurl does copy the data) by setting the CURLOPT_COPYPOSTFIELDS(3) option.
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used),
which is commonly used by HTML forms. Change Content-Type with CURLOPT_HTTPHEADER(3).
You can use curl_easy_escape(3) to url-encode your data, if necessary. It returns a pointer to an encoded string that can be passed as
postdata.
Using CURLOPT_POSTFIELDS(3) implies CURLOPT_POST(3).
If CURLOPT_POSTFIELDS(3) is explicitly set to NULL then libcurl will get the POST data from the read callback. If you want to send a zero-
byte POST set CURLOPT_POSTFIELDS(3) to an empty string, or set CURLOPT_POST(3) to 1 and CURLOPT_POSTFIELDSIZE(3) to 0.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER(3) as
usual.
To make multipart/formdata posts (aka RFC2388-posts), check out the CURLOPT_HTTPPOST(3) option combined with curl_formadd(3).
DEFAULT
NULL
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, 12L);
/* pass in a pointer to the data - libcurl will not copy */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
curl_easy_perform(curl);
}
AVAILABILITY
Always
RETURN VALUE
Returns CURLE_OK
SEE ALSO CURLOPT_POSTFIELDSIZE(3), CURLOPT_READFUNCTION(3),
libcurl 7.54.0 June 11, 2016 CURLOPT_POSTFIELDS(3)