Group Abstract Group Abstract

Message Boards Message Boards

0
|
20 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How can I import a doc directly into Mathematica from a URL that requires authentication

Posted 14 hours ago

I've been downloading documents to my local drive from an archive that requires authentication in the form of UserAgent name and email and Host URL. I've been using URLDownload to do this.

URLDownload[
  HTTPRequest[
   urlOfRemoteFile, <|"UserAgent" -> "firstName lastName emailAddress", 
    "Host" -> "hostURL"|>],
  pathToLocalDirectory"];

But is it possible to use Import or some other function to load the contents of the file directly into a Mathematica notebook without having to save the file locally? I've tinkered with Import but can't get the authentication right.

Any hint would be appreciated.

POSTED BY: Gregory Lypny
Posted 14 hours ago

Just figured it out: wrap HTTPRequest in Import.

POSTED BY: Gregory Lypny
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard