[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI : Only the http protocol is available!



Hi John,

When you reply to a digest, please change the message subject.  Otherwise, 
when people receive your mail, they just get a message with a subject that 
says "HTTP digest #123  . . ." and that's not very helpful.  Furthermore, 
this subject ends up in the archives, where it's not useful to someone 
trying to solve the same problem.   So please just change it to the 
subject of the message you're replying to, or else something like 
"Userid/Password help".  Thanks.


EXAMPLE7 demonstrates how to set userid/password when a Web site uses the 
HTTP authentication mechanism (either basic or digest) to request a userid 
and password.

I hope that the stuff in EXAMPLE7 solves the problem, because it's much 
simpler than the alternative -- I'll describe the alternative below:

Many sites don't use this mechanism. Instead, they'll present a web form 
where the user has to key in a userid/password.  This form works just like 
any other web form (such as those used for keying a search string into 
google, keying a ship-to address into Amazon.com, etc, etc) and isn't 
specific to userid/password fields.  Usually after signing you in, they'll 
set a cookie with a session key so that they'll recognize you in the 
future.

To deal with that scenario you need to:

a) Turn cookies on before calling other routines in HTTPAPI
        http_use_cookies(*ON);

b) Look at the HTML code for the site to see what the form looks like. 
There'll be <input> tags that describe the parameter name & data that gets 
sent back to the server.

c) Create URL encoded parameters using the HTTP_url_encoder_xxxx() 
routines from HTTPAPI. (Example2 demonstrates this... the parameters you 
set will be the ones you discovered in step b).

Once you've signed in this way, and the cookie has been set, you can 
proceed to do whatever steps are next.

---
Scott Klement  http://www.scottklement.com

On Fri, 28 Jul 2006, John J wrote:

> Hi Scott,Thanks for your reply, the person who had installed HTTPAPI 
> didn't say Yes for HTTPAPI with ssl support. Now I reinstalled and this 
> time I am not getting that error, but I am getting error saying that 
> "This page requires a user-id & password". I think I am not sending 
> user-id and password in right format. I tried the way that you did for 
> UPS tracking example and also https://<user>:<password>@url, but still 
> it's not working. Can you please let me know how can I do that, your 
> help is really appreciable.
>
> Thanks,
> John

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------