New answers tagged

1

Since you do not have /etc/ssl, I advise adding the curl -k option to your command. -k, --insecure (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed ...


2

It's a kind of necroposting but I've had the same problem recently (with a different backend) and found that the reason is in a wrong Content-Type. By default it's "text/plain" or "text/html", and in my case curl -H "Content-Type: application/json" -d ... solved the issue.


0

I have found a solution: I downloaded Phantom JS which is a headless browser. Wrote a little javascript which loggs in to the Website and save the HTML Page. Works like a charm. You can find many tutorials and documentation online exactly for this purpose.


1

Depends upon which unix/linux you are using, you would need to install "curl" package. If it supports rpm, install curl rpm after downloading from any rpm repositories (e.g. http://rpmfusion.org/ ) or setup yum. If its debian based try getting debian based package using apt-get etc. Note: download and install only those packages which are compatible to ...


0

If I understand correctly, you have a file containing a list of URLs (one per line), and you want to pass those URLs to CURL. There are two main ways to do that: with xargs, or with command substitution. With xargs: xargs <urls.txt curl … With command substitution: curl … $(cat urls.txt) Both methods mangle some special characters, but given what ...


2

One way to avoid having bash word-splitting is to use an array to carry each argument without any need for escaping: push(){ args[${#args[*]}]="$1"; } build() { args=() for file do push "-F" push "filedata=@$file" done } build "$@" curl --progress-bar -i "${args[@]}" https://transfer.sh | grep https The build function creates an ...


3

Give a try to this standard and safe solution: transfer() { printf -- "-F filedata=@%s\0" "$@" | xargs -0 sh -c 'curl --progress-bar -i "$@" https://transfer.sh | grep -i https' zerop } "$@" with the Double-Quotes will make the shell keeps the original options unchanged. See 2.5.2 Special Parameters section from The Open Group Base Specifications Issue ...


0

The mistake was: rc=$( curl ... ) This gave me the http code back because I filled $rc with the stdout of curl. I have to fill rc with $?afterwards. After changing my code to: httprc=$( curl ...) rc=$? I got both "return" codes back. Thanks to meuh!


1

curl --fail does part of what you want: from man curl: -f, --fail (HTTP) Fail silently (no output at all) on server errors. This is mostly done to better enable scripts etc to better deal with failed attempts. In normal cases when an HTTP server fails to deliver a document, it returns an HTML document stating so (which often also describes why and ...


2

No, in general this isn't possible. A FTP server usually has commands to get information about files and directories and to store, retrieve, delete and rename files. Commands to mount devices and to send messages to users are also standardized but not implemented in current servers. See the list of FTP commands on Wikipedia for details. No RFC mentions a ...



Top 50 recent answers are included