We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Providing credentials via HTTP
Page Index Toggle Pages: 1
Providing credentials via HTTP (Read 471 times)
Providing credentials via HTTP
Jun 10th, 2008, 3:20pm
 
I'm interested in logging into a website where I am a user in order to pull data off of it for use in a Processing app. Does Processing's Network library or another support that functionality?

Thanks for any help!

Re: Providing credentials via HTTP
Reply #1 - Jun 10th, 2008, 4:19pm
 
if it's simple user/password via a pop-up dialog in the browser, you may be able to use something like:
http://user:pass@www.blah.com
as your url. but there are very few sites that work that way anymore.

the solution is to use the apache commons httpclient, which can handle session information, and log you into forms:
http://hc.apache.org/httpclient-3.x/
Re: Providing credentials via HTTP
Reply #2 - Jun 10th, 2008, 4:21pm
 
Thanks, fry, I'll take a look at that!

Re: Providing credentials via HTTP
Reply #3 - Jun 10th, 2008, 4:21pm
 
I think that depends entirely on how the website does it's authentication. if it's via HTTP Basic authorisation, I think you might be able to get at data like:

Code:
loadStrings("http://myUser:myPass@www.thesite.com/whatever");

Though I know there was a patent issue about that format, so IE doesn't do it any more, though firefox does... which way java goes I don't know.

Re: Providing credentials via HTTP
Reply #4 - Jun 10th, 2008, 4:31pm
 
Thanks, JohnG. The website uses an AJAX overlay that pops up when I click Login. I'll look into it but don't think your (very helpful!) idea will work. More here, later, if it does.
Page Index Toggle Pages: 1