Hello Aldebaran,

The quick answer to your question Could $host be a remote website with which I currently use sftp? is yes it can.

The longer version and my recommendation is not to use HTTP/HTTPS to upload files. My module is a customization which in the background uses REST::Client to do all the communication.

Further analysis why I do not recommend to use HTTP/HTTPS for uploading files?

HTTP and HTTPS are also stateless protocols. They may require new conn +ections for each transfer, and so they may not be suitable if a large + number of files need to be transferred.

Reference Source HTTPS or SFTP – which is best?.

SFTP is a protocol designed for this purposes (file transfer) using SSH connections.

If you ask my opinion I would continue using the Net::SFTP::Foreign module but with a small modification, I would use SSH keys instead of sending username and password. If you want to see a sample of code on how to use SSH keys connection Re: Net::SFTP::Foreign Password Authentication Hangs (UPDATED). There are many reasons on why to use SSH keys instead of password, the really fast answer is because it is way more secure and less communications between client/server.

To conclude, yes it is possible to send a file through HTTP/HTTPS (SSL encryption) with the help of my module that uses REST::Client or directly modify it for your needs, but I would not recommend it unless if you did not had the ability to use SSH strictly HTTP/HTTPS.

You also asked what is Snippet is the name that I used for the data that is send from the server.

Let me know if you have more questions.

BR / Thanos

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^3: Sample REST request & response code by thanos1983
in thread Sample REST request & response code by kanewilliam7777

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.