BookmarkSubscribeRSS Feed
Pramod_R
Calcite | Level 5
Hi,

I've been trying to use the proc http to download a simple html page from one of our internal website. This page requires authentication to access. I've been accessing this page using the wget -O functionality in UNIX, by specifying the user id and password in .netrc file in my home directory.

However, when I try the below code in SAS 9.2, the html page that I get is login page which still asks my credentials to login.

filename in "~/ProxyTest_in";
filename out "~/ProxyTest_out.html";
filename hdrout "~/headerOut.txt";

data _null_;
file in;
input;
put _infile_;
datalines4;

;;;;
run;

proc http
in=in
out=out
headerout=hdrout
url="http://login.myportal.com/portal/Comp/TCC/landingPage"
method="post"
ct="application/x-www-form-urlencoded"
webpassword="pwd"
webusername="userid"
proxyport=80
proxyhost='http://login.myportal.com'
;
run;

The header message shows that the response code is 200. However, the html page is not going beyond the login page.

Note: When I copy this link in a browser, it uses my windows authentication and takes me directly to the home page (supasses the login page). Same is the case when I used to do a wget (using .netrc as the authentication mechanism).

Thanks in Advance!
Pramod
1 REPLY 1
Ksharp
Super User
At support.sas.com I found an example.But not sure whether it can work.
[pre]
filename foo url 'https://www.b.com/file1.html'
user='jones' prompt;

[/pre]

Ksharp

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1804 views
  • 0 likes
  • 2 in conversation