0

I would normally do:

read.csv(pipe("wget -O- stdout http://someServer/aFile.csv"))

But in this case the wget command that works is this one:

wget -O- stdout http://someServer/aFile.csv --user=foo --ask-password 

This prompts for a password before working. If I pass this to pipe it hangs, is there a workaround that wouldn't require clear typing the password?

Palace Chan
  • 8,845
  • 11
  • 41
  • 93
  • look at `httr`; specifically the `GET()` function with `write_file()` and `authenticate()` parameters – hrbrmstr Jun 15 '16 at 00:08
  • This authentication parameter in the documentation seems to take the password in clear text too though... – Palace Chan Jun 15 '16 at 00:13
  • it stays in-process, though (unlike the `wget` call). If you have the "encrypted" password (basic auth is horribad and worthless if not over ssl/tls) pre-created, you can just insert it manually with `add_headers()` – hrbrmstr Jun 15 '16 at 01:07
  • I suppose if that's the best option I can abstract it into a function call that requires the password as an argument and disable Rhistory :/ – Palace Chan Jun 15 '16 at 01:16
  • honestly, if the server isn't using ssl/tls it really doesn't matter one bit. basic auth uses base64 encoding. there's no encryption happening at all. anyone looking over the wire (which is more than folks think) has your creds. – hrbrmstr Jun 15 '16 at 02:02

0 Answers0