Questions tagged [curl]

cURL is a CLI tool for issuing HTTP GET, POST, & PUT request.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

Cannot locate “php-phalcon” package in APT, after cURL'ing the .deb file

In Debian 10, I follow the instructions here to a tee, I cURL the DEB file, then I enter apt install php-phalcon or php7.0-phalcon. Neither work! I don't know what's wrong It says: Unable to locate ...
0
votes
1answer
27 views

Shell script cUrl command with URL being a variable

I am working on a shell script that would place get requests until the status is 202. I have an issue with building the cURL command as mentioned below. Request is not being placed, even though the ...
0
votes
1answer
20 views

bash script variable from curl

I think I am missing something simple here, but here goes. Thsi works from the command line with no problem, it give me the required output. curl -X GET \ -H "X-Auth-Email: REDACTED" \ -H "...
0
votes
1answer
1k views

Session id using curl_7_35

I want to use curl to get the session id. So, please help me if there is any way to get the session id using Curl. Earlier I was using Open SSL to capture the session id. Now, I don't want to use it. ...
0
votes
1answer
915 views

After logging in and downloading cookies using --cookie-jar, how do we use the downloaded cookies to access the page again?

I used the command below to download cookie using CURL in bash. How do I use this file (cookies.txt) to access the page? curl -u username --cookie cookies.txt --cookie-jar cookies.txt https://example....
24
votes
6answers
13k views

What are the alternatives for checking open ports, besides telnet?

We can use the following in order to test telnet VIA port; in the following example we test port 6667: [root@kafka03 ~]# telnet kafka02 6667 Trying 103.64.35.86... Connected to kafka02. Escape ...
267
votes
4answers
147k views

What is the difference between curl and wget?

I am keen to know the difference between curl and wget. Both are used to get files and documents but what the key difference between them. Why are there two different programs?
1
vote
1answer
1k views

Posting to socket using curl

I'm struggling to get curl and socat to play nicely together. The situation is the following: I post XML to login to a system. Return message contains authentication token. I post subsequent requests ...
1
vote
0answers
36 views

Issues interacting with Windows Shares without mounting

I am rebuilding a legacy system using Kubernetes, and do in some cases need to read and write files to Windows shares. I have tried working with our internal cloud providers to install various ...
5
votes
6answers
18k views

Curl with ipv6 not working by default

I am trying to curl ipv6 addresses, but without success. If I try lets say: curl https://google.com I wait for a timeout and get network unreachable If I force ipv4, everything is fine. curl ...
1
vote
1answer
1k views

Bash script curl input variable from command line

I would like to be able to pass in what environment when script is run. Like script.sh dev ($dev would populate appropriate URL in curl command in script). Maybe even print the environment as options ...
1
vote
1answer
40 views

How to pipe git log to curl command

My goal is to perform a curl with the output of a command as curl payload, separately they work, but i have not been able to merge both things into one. This is my first command, it prints the ...
0
votes
1answer
32 views

What does the parenthesis around a use flag means?

I want to build my curl with the quiche support. I have enabled the use flag in the package.use file, but it does not take effect. I noticed there are a pair of parenthesis around the use flag. What ...
1
vote
2answers
2k views

How to install php7.2-curl on a Debian 10? It depends on libcurl3 that is not available

I need php7.2-curl. But on Debian 10 apt says that it cannot be installed due to a dependency with libcurl3. But libcurl3 cannot be installed (it gives me no reason). Must I rollback to Debian 9.9? ...
0
votes
1answer
60 views

curl: Argument list too long

I got an error for this line: curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "$RESPONSE" curl: Argument list too long How I could fix it?
0
votes
2answers
1k views

How to send a file for single POST parameter with CURL?

I want to send myfile.json for one POST parameter while specifying explicit value for another parameter with CURL. Is it possible? Something like POST a=value1&b=<load and encode from my file....
0
votes
1answer
35 views

Curl command in bash CGI script not displaying the XML output [data not shown]

if I run this command in linux shell. curl=`curl --connect-timeout 4 -k -X POST -H "Content-type: text/xml" --data "<MyRequest><HeartBeat timestamp=\"1311157780201\"></HeartBeat><...
0
votes
1answer
22 views

Passing few curl variable to bash script

I would like to pass a few curl variables like time_pretransfer, time_connect in variables on my script. curl -skw "\ntime_connect: %{time_connect}s\ntime_namelookup: %{time_namelookup}s\...
0
votes
2answers
1k views

403 http code appears when I go to a certain website

I wrote a PHP script to a particular site using a home computer for debugging. Script worked properly, when I tested it on a home computer. The script has stopped working when I deploy the script on ...
17
votes
3answers
23k views

curl download multiple files with brace syntax

I am trying to download two files by the following syntax: curl -O http://domain/path/to/{file1,file2} The problem is that only the first file is actually saved locally, and the second was simply ...
-2
votes
0answers
32 views

Centos 7 cannot upgrade my Kernel

I follow the hint https://linuxhint.com/upgrade-kernel-centos-7/ and type this command at the kernel : rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org It gives the following error :...
8
votes
3answers
47k views

cURL doesn't connect to HTTPS while wget does (NSS error -12286)

I'm getting error NSS error -12286 while downloading a file from HTTPS using curl. I can download the same file without issues using wget so I can exclude any firewall or blacklist issues. Already ...
0
votes
1answer
49 views

How to use pipes and stdin with commands that use - characters [duplicate]

I'm trying to curl a txt file and pipe it to pip. Example: curl -s URL | pip install -r - It doesn't work beucase the last - is not the curl output as I'd expect. I often have this issue with ...
0
votes
1answer
976 views

Curl fails to download a file during start up

I am adding startup script in Ubuntu with update-rc.d. My script says : #!/bin/bash nohup curl -C - -o ~/Downloads/linuxmint-17-xfce-dvd-64bit.iso.part 'http://mirror.umd.edu/linuxmint/images/...
4
votes
1answer
1k views

TOR hidden service not always accessible through cURL. Takes multiple tries

When I try to access a hidden service on TOR using cURL, for some reason I'm not getting access to the site 100% of the time. Many times it returns "curl: (7) Can't complete SOCKS5 connection to 0.0.0....
0
votes
1answer
20 views

How to save cookies when the app write to document.cookie?

I'd like to understand how to save cookies that the application writes to document.cookie (https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie), as I've noticed that the common methods ...
0
votes
1answer
3k views

cURL: Request to http and https by default

A server is running on 5000 port. I have to write a bash script to cURL that URL and parse the response. Here the problem is server can run on either http or https protocol. That means I have curl ...
1
vote
2answers
5k views

Extract value from JSON document returned by curl

[ec2-user@ip-10-0-1-238 ~]$ curl "https://tools.keycdn.com/geo.json?host={18.205.6.240}" {"status":"success","description":"Data successfully received.","data":{"geo":{"host":"18.205.6.240","ip":"18....
0
votes
1answer
25 views

Shell can't resolve argument [duplicate]

I am passing arguments to the shell script below ./script.sh pan.tgz 192.168.3.1 ABCXYZ #!/bin/sh echo $1 $2 $3 file=$1 host=$2 key=$3 curl -kv -o ${file} 'https://${host}/api/?type=export&...
0
votes
1answer
42 views

Understanding the command “apt install curl nano unzip -y”

I am trying to understand this command: #apt install curl nano unzip -y I think it to means install curl, unzip the archive and all questions answer yes. Have I understood it correctly?
2
votes
1answer
1k views

Curl NSS / SSL error after update

I use a custom internal authentication server. With the last round of updates it started having issues, apparently due to a change in the ciphers. This is on a CentOS6 box, fully updated. curl https:...
2
votes
2answers
44k views

Why am I getting “Curl (6) Could not resolve host” after I did a “yum -y update”?

I have a CentOS 7.3 machine that is a guest running on Oracle VirtualBox. The host is a Windows machine. I can ping 8.8.8.8 from the Linux server. The Linux server can ping itself by its hostname ...
3
votes
1answer
4k views

SSL Certificate Problem: unable to get local issuer certificate

I am having small initramfs with static busybox into it. The sole purpose of this initramfs is to download/upload files to the HTTPS server. I have the proper certificate and credentials to do so. ...
0
votes
0answers
45 views

301 error when checking nginx_status

Zabbix shows 301 error when trying to get nginx_status. This is how my zabbix.conf looks like: server { listen [::]:80; server_name 127.0.0.1; location /nginx_status { stub_status on; ...
-2
votes
1answer
78 views

end curl command?

curl "https://dummy.net/v1/users/titles/privacy' > -XGET \ > -H ‘Referer:https://dummy.net/friday/?f’ \ > -H ‘Authorization:Bearer xxxxxxxxxxxxxxx’ \ > -H ‘User-Agent:Mozilla/5.0 (...
0
votes
0answers
29 views

How do I use bash script to parse a JSON and run related commands according to the parsed results? [duplicate]

I have a JSON file (array) like this: [ {"name":"Joe","age":36}, {"name":"John","age":14}, {"name":"Linda","age":62} ] And I want to parse it in shell, analyzing every item in the array, then ...
0
votes
1answer
21 views

how to download specific pip version on linux redhat

we can download the latest pip as curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current ...
0
votes
2answers
2k views

Curl not returning response

I have a scenario where I was using curl --noproxy "*" https://.. to get the response but suddenly when I use it now it doesn't return me the response instead it says curl: (60) Peer certificate ...
0
votes
2answers
33 views

Using an array of strings with spaces in bash - error messages “curl: could not resolve host”

I am attempting to write a script in bash that monitors certain aspects of a server, and sends a message to slack if it notices that something is wrong. However, I am running into a strange set of ...
0
votes
1answer
940 views

curl hangs during http download

I have a VM running CentOS 6. On this Linux box, I run 4 curl download concurrently. In some case, one of the curl download hangs. ps shows that curl process is still there. And netstat shows the ...
0
votes
1answer
1k views

Unable to use curl with cookie-jar

I am trying to use curl for login request automation. Here, use of cookie-jar is must. When I use --cooki-jar cjar option, it shows following error. root@kali:~# curl --cookie-jar cjar --output /root/...
1
vote
4answers
5k views

curl hangs after client hello

When I execute the following command in Ubuntu: curl -v --insecure -XGET 'https://user:pass@IP_ADDR:PORT/SOME_FILE.php' I get this output: * Hostname was NOT found in DNS cache * Trying IP_ADDR.....
31
votes
3answers
53k views

Passing binary data to curl without using a @file

Is it possible to use curl and post binary data without passing in a file name? For example, you can post a form using binary via --data-binary: curl -X POST --data-binary @myfile.bin http://foo.com ...
0
votes
1answer
81 views

How to ignore first line of content in curl standard output? [duplicate]

When I use curl -s to access a text file, it will display the entire content. Is there any way to ignore the first line of content? Test text file link: curl -s https://raw.githubusercontent.com/...
0
votes
1answer
69 views

How to get remote file modification time and size from a shell script?

I have a Linux VPS, There are many HTML forms on it, as follows: <table> <thead> <tr> <th>ver</th> <th>link</th> &...
215
votes
2answers
297k views

Hide curl output

I'm making a curl request where it displays an html output in the console like this <b>Warning</b>: Cannot modify header information - headers already sent by (output started at /home/...
0
votes
0answers
13 views

curl: put file content on header

I need to send an http request using curl attaching a certificate into a header. The problem arises since I'm trying to send it setting it into command line: $ curl -X GET https://<url> -H '...
2
votes
1answer
975 views

How to upload a file to FTP via curl but from stdin?

Basically, I'm trying to do this: some_other_program | curl ftp://username:password@192.168.1.10/file.txt As a test case to see if I can get it working, I'm trying it with cat like so: cat test.txt ...
0
votes
1answer
3k views

how to put variable in CURL header using shell script?

I want to call an API using shellscript but I m not able to put header properly...whats going wrong in my script... thanks in advance. shell script : #!/bin/bash curl -H "Authorization: Basic ...
4
votes
2answers
117 views

Launching Multiple Queries With Bash Script

I have the following bash script (on this post): #!/bin/bash while read LINE; do curl -o /dev/null --silent --head --write-out "%{http_code} $LINE\n" "$LINE" done < infile > outfile infile: ...