How to run the HTTP request without using CURL

busybox has wget but this limited and unsuitable for posting. You can combine busybox with netcat (or nc) for achieving the result. You only need to download netcat binaries for your platform. And here we go: POST_PATH=”/login.cgi” HOST= BODY=”Put here HTML body….” BODY_LEN=$( echo -n “${BODY}” | wc -c ) echo -ne “POST ${POST_PATH} HTTP/1.0\r\nHost: … Read more

Databricks: Download a dbfs:/FileStore File to my Local Machine?

There are a few options for downloading FileStore files to your local machine. Easier options: Install the Databricks CLI, configure it with your Databricks credentials, and use the CLI’s dbfs cp command. For example: dbfs cp dbfs:/FileStore/test.txt ./test.txt. If you want to download an entire folder of files, you can use dbfs cp -r. From … Read more

curl: Per-file Content-Type for multipart POST (YouTube API)

First, you can specify the content-type for a part you upload by adding “;type=magic/string”. Like for example in your video case: curl -F “[email protected];type=video/mpeg4” [URL] (use –trace or –trace-ascii to verify that curl sends exactly what you want it to) … but this said, I’d guess that it is highly unlikely that the receiving server … Read more

curl 302 redirect not working (command line)

You need to supply the -L or –location option in order to enable curl to follow HTTP redirects. Quoting from man curl: -L, –location (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo … Read more

Downloading all the files in a directory with cURL

If you’re not bound to curl, you might want to use wget in recursive mode but restricting it to one level of recursion, try the following; wget –no-verbose –no-parent –recursive –level=1 \ –no-directories –user=login –password=pass –no-parent : Do not ever ascend to the parent directory when retrieving recursively. –level=depth : Specify recursion maximum depth … Read more