indy

Indy 10 Http Server sample

旧城冷巷雨未停 提交于 2019-11-28 20:42:18
I need a simple code sample for Indy 10 Http Server When request (post) simply displays it Is there an Indy 9 sample for this? Thanks Start a new VCL Forms project Drop a TidHTTPServer component onto the Form Double-click the form to create an OnCreate() event and activate the server IdHTTPServer1.Active := True; Back on the form, select the HTTP Server component, and create an OnCommandGet event In this OnCommandGet event (which is called within a child thread whenever a GET/POST occurs), handle the request, by populating the response.. AResponseInfo.ContentText := '<html><head><title>My

Download a File from internet programmatically with an Progress event using Delphi and Indy

南楼画角 提交于 2019-11-28 17:19:14
I need a way to download a file from the Internet using Delphi via HTTP, Which include an Progress event, I'm looking for a method which uses the Indy components. I am using Delphi 7. I've coded this example, using just one HTTP GET, with Indy 10, hope it works with Indy 9 too: uses {...} IdHTTP, IdComponent; type TFormMain = class(TForm) {...} private {...} procedure HttpWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); end; {...} procedure TFormMain.Button1Click(Sender: TObject); var Http: TIdHTTP; MS: TMemoryStream; begin Http := TIdHTTP.Create(nil); try MS := TMemoryStream

How do I create an IHTMLDocument2 using a string from TIdHTTP?

孤者浪人 提交于 2019-11-28 12:23:15
I download a URL with IdHTTP.Get , and I need to search the HTML tags and extract some data. How I can convert the string that IdHTTP.Get returns into an IHTMLDocument2 ? Try this one: uses ... Variants, MSHTML, ActiveX; var Cache: string; V: OleVariant; Doc: IHTMLDocument2; begin ... Cache := IdHTTP.Get(url); Doc := coHTMLDocument.Create as IHTMLDocument2; // create IHTMLDocument2 instance V := VarArrayCreate([0,0], varVariant); V[0] := Cache; Doc.Write(PSafeArray(TVarData(v).VArray)); // write data from IdHTTP // Work with Doc end; I Googled this problem and I can find a good code for this:

How to statically link Indy SSL files?

为君一笑 提交于 2019-11-28 11:29:36
How can I statically link Indy OpenSLL files? AFAIK only ICS allows this but for some weird reason Indy doesn't. Neither does it provide .obj files? This will allow me to avoid any dependency on the dll's. OpenSSL is primarily meant to be used dynamically. That allows for easy upgrades when new OpenSSL versions are released. However, OpenSSL can be compiled statically as well, and Indy 10.6.0+ does support linking to OpenSSL statically, but currently only supports that on iOS devices (because Apple does not allow OpenSSL to be linked dynamically). On all other platforms (including the iOS

Delphi: Indy - how to get the response body on error?

别来无恙 提交于 2019-11-28 09:20:46
Delphi6 and XE3. I want to get the real response body of a request. But the server makes error 500. Then the Indy replace the response text with the description of the error. This homepage is designed for answer 500 in non abnormal operations too, and we need to determine what to do from response text. Could I get the response text from IdHTTP or from an Exception object when the status code is 500? Thanks for any info! When TIdHTTP encounters a server error, it raises an EIdHTTPProtocolException exception, where its ErrorCode property contains the HTTP status code (500, etc), its Message

INDY 10.1.5 - Which SSL dlls work with Delphi 2006?

心不动则不痛 提交于 2019-11-28 09:06:16
I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but I am getting the following SSL errors: 1) If I use the SSL dlls from openssl-0.9.8i-i386-win32.zip I get the error: "Could not load SSL library" 2) If I use the SSL dlls from indy_OpenSSL096m.zip I get the error: "Error connecting with SSL" 3) If I use the SSL dlls from openssl-0.9.8h-i386-win32-Indy-IntraWebEdition.zip I get the error: "Could not load SSl Library" Now I've researched this and there are a lot of recommendations with dead links to dlls about, including links on stack overflow. I

Indy - IdHttp how to handle page redirects?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 08:42:21
Using: Delphi 2010, latest version of Indy I am trying to scrape the data off Googles Adsense web page, with an aim to get the reports. However I have been unsuccessful so far. It stops after the first request and does not proceed. Using Fiddler to debug the traffic/requests to Google Adsense website, and a web browser to load the Adsense page, I can see that the request (from the webbrowser) generates a number of redirects until the page is loaded. However, my Delphi application is only generating a couple of requests before it stops. Here are the steps I have followed: Drop a IdHTTP and a

Log in to website from Delphi

牧云@^-^@ 提交于 2019-11-28 08:35:49
I would ask if someone was kind enough to explain to me how to login at webpage from Delphi app. All the examples I've found here have proved useless to me or I'm doing something wrong. I'm tired of the search and the code that does not work. There is no error message, I even get page code into Memo but seems it's code from login page (not account [dashboard] page) - seems this code can't pass auth at all and I don't know why. What is wrong in this code : procedure Login; var HTTP: TIdHTTP; Param: TStringList; S: String; begin HTTP := TIdHTTP.Create(nil); HTTP.CookieManager := Main_Form

EIdOSSLConnectError Error connecting with SSL - EOF was observed

核能气质少年 提交于 2019-11-28 05:40:32
问题 My platform is this OS X Yosemite 10.10.5 newest Indy (10.6.2.0, download 2016 March 13 - Indy10_5346.zip) Lazarus 1.4.4 Concerning OpenSSL versions I have tried: HomeBrew OpenSSL installed like this: "brew install openssl --universal" Built-in (0.9.8) OS X supplied in /usr/lib/ I am getting error: EIdOSSLConnecError Error connecting with SSL - EOF was observed that violates the protocol In file Protocols/IdSSLOpenSSLHeaders.pas at line 19418 However, as I am using newest of everything - why

Using INDY 10 SMTP with Office365

故事扮演 提交于 2019-11-28 04:45:04
问题 I'm not familar with the INDY SMTP component. I want to send a mail with INDY and Office 365. Here is a nice topic which helped me a lot: What do the SMTP Indy component security and authentication properties do? But I did not figured out how to use SASL. Office365 adress is smtp.office365.com with port 587 and TLS. So I added an SMTP and an OpenSSL-IOHandler to my form and setted the properties. But I didn't work, the app is just freezing. I need to know how to use SASL with Office365.