curl / Mailing Lists / curl-library / Single Mail

curl-library

Request: flag for delayed start of HTTP until STDIN sends EOF

From: Rudy via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 9 Oct 2017 10:17:18 -0700

I have a script that takes a couple of minutes to run, and I pipe the
ouput to curl to 'save' the output to an internal ops server. Piping
into curl doesn't work as the script is not done and for some reason
curl starts the HTTP session with the server and doesn't send the file.

It would be neat to have a flag in curl that 'waited until EOF before
starting the HTTP session with the server'.

Problem:
slow_script.pl | curl "-FmyUpload=@-;filename=foo.txt"
https://user:pass@haxx.se/upload.php

Work Around:
slow_script.pl | (sleep 60 && curl "-FmyUpload=@-;filename=foo.txt"
https://user:pass@haxx.se/upload.php)

Goal:
slow_script.pl | curl "-FmyUpload=@-;filename=foo.txt"
--wait-for-eof-for-upload https://user:pass@haxx.se/upload.php

As the years go by, I am sure I'll have to bump the 60 to 120 seconds
(or rewrite my script).  with the flag in place, sys admins around the
work could put off refactoring shell scripts for years!  Think about all
the time saved!

Rudy

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-10-09