|
PowerBASIC Forums
![]() Programming the Internet
![]() SSL/HTTPS
|
| next newest topic | next oldest topic |
| Author | Topic: SSL/HTTPS |
|
Ron Pierce Member |
Is anyone aware of a means of accessing a HTTPS web page with PowerBASIC? In VB, the Internet Transfer Control supports this. Any help hitting a HTTPS page with PBCC/PBDLL greatly appreciated. Does anyone use SSL with PowerBASIC? I can't find any references. Thanks, IP: Logged |
|
Jakob Faarvang Member |
Just use the WinInet functions to do this. An example is available here http://www.powerbasic.com/support/forums/Forum7/HTML/001135.html To fetch an https page, just send the URL of the page through Wininet, e.g. https://secureserver/ If your page is password protected, just use a URL similar to the following: https://username:password@secureserver/address/ Good luck, [This message has been edited by Jakob Faarvang (edited February 05, 2002).] IP: Logged |
|
Ron Pierce Member |
Thanks, Jakob. I will give this a go. Have you used the code to "talk" to a HTTPS url? IP: Logged |
|
Jakob Faarvang Member |
Yep. It's very straightforward - WinInet doesn't really care if you talk to HTTP or HTTPS servers (or gopher, ftp etc. servers, for that matter). (Note that for FTP servers, there are a whole different set of commands, but you can still use the mentioned code to fetch a direct file - e.g. ftp://ftp.mysite.com/address/filename.txt ) - Jakob IP: Logged |
|
Joshua Zavelovich Member |
Hi Jakob: I tested your code - works fine! Unfortunately I cannot use the same approach in my task. The WININET function that you used in this sample InternetOpenUrl - always create "GET" header in the message sent to the server. I need to "POST" the message and I tried to accomplish it with the sequence of other WININET functions that should be equivalent to InternetOpenUrl: InternetConnect However I encountered another problem. I have to have totally customized message headers. WININET says that customization is supposed to be accomplished with editing/removal of headers by HttpAddRequestHeaders. I used this function and it failed! Here are the headers I could not remove: Joshua Zavelovich ------------------ IP: Logged |
|
Jakob Faarvang Member |
Check out MS' documentatin on HTTP sessions at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/http_sessions.asp .. That page contains a whole section on "Posting Data to the Server".. But.. According to the documentation on InternetOpenUrl, you can send along headers with the InternetOpenUrl request:
quote: Are you sure this is not enough for you? If it isn't, then you'll have to read up on the HTTP sessions as described above, but many webservers are "nice enough" to allow you send along post data with a get request... Hope this helps.. IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.