[root@receiver]# curl -v -O https://example.com/upload/
...
Location: https://example.com/upload/XXXXXX
...
[root@sender]# curl -T a_file_to_send_to_reciever https://example.com/upload/XXXXXX
- receiver queries GET to the endpoint URL
- server redirects a URL
- receiver queries GET the new URL, and wait response
- sender queries POST to the URL that is redirect URL
- server get data from sender, and pipe it to the receiver
- finally sender sends data to receiver with no buffer left
I want to send some files to the other servers, but no local connection between here and other.
Fortunately, both here, and the other can reach Internet. Thus, I usually POST a file my server from here, and GET the file on the other.
This works fine in small times less than one hundred times. I regularly clean up a directory that stores these upload files.
This can solve by something, one time URL to GET after POST.
- sender POST a file
- server save the file
- receiver GET the file
- server delete the file
But this way has a few bad points.
- my server always uses 100% of disk volume
- receiver will wait until sender completes POST
at the last line of bad points;
x until
o till