indy

How can I wait for a string from a server with IdTCPClient?

…衆ロ難τιáo~ 提交于 2019-12-19 04:34:10
问题 I have a problem with IdTelnet (indy 10.1). I can't read the data from a server in Unicode mode. and now I want to write the telnet terminal with IdTCPClient. The server sometimes send one line and sometimes more and more lines. But there is not a fixed time between sending. Now my problem is that when I must read data from InBuffer. Or when I must use the ReadLn function to read the data from the server, how many times must I run the ReadLn? 回答1: TIdTelnet is a multithreaded component. It

Delphi TIdhttp Post JSON?

99封情书 提交于 2019-12-18 16:51:30
问题 Anybody getting JSON to work with TIdHttp ? The PHP always return NULL in the $_POST , am I doing anything wrong ? Delphi source: http := TIdHttp.Create(nil); http.HandleRedirects := True; http.ReadTimeout := 5000; http.Request.ContentType := 'application/json'; jsonToSend := TStringStream.Create('{"name":"Peter Pan"}'); jsonToSend.Position := 0; Memo1.Lines.Text := http.Post('http://www.website.com/test.php', jsonToSend); jsonToSend.free; http.free; PHP source: <?php $value = json_decode($

Delphi: Get MAC of Router

丶灬走出姿态 提交于 2019-12-18 13:18:01
问题 I am using Delphi and I want to determinate the physical MAC address of a network device in my network, in this case the Router itself. My code: var idsnmp: tidsnmp; val:string; begin idsnmp := tidsnmp.create; try idsnmp.QuickSend('.1.3.6.1.2.1.4.22.1.2', 'public', '10.0.0.1', val); showmessage(val); finally idsnmp.free; end; end; where 10.0.0.1 is my router. Alas, QuickSend does always send "Connection reset by peer #10054". I tried to modify the MIB-OID and I also tried the IP 127.0.0.1

How to make an HTTPS POST request in Delphi?

无人久伴 提交于 2019-12-18 12:53:25
问题 What is the easiest way to do an HTTPS POST request in Delphi? I'm not having problems with making HTTP POST requests, but how can I do it using SSL? I've googled around and haven't found anything that explains this well enough. Here's the code I tried: procedure TForm1.FormCreate(Sender: TObject); var responseXML:TMemoryStream; responseFromServer:string; begin responseXML := TMemoryStream.Create; IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(self); with

Delphi Pos always returning 0

允我心安 提交于 2019-12-18 07:22:12
问题 I really don't know why Pos keep returning 0 instead of the char ";" position in string I have to get a response of a php page which outputs a Content-Type: text/plain So one example output is 2;fulano;fulano;0 3;ciclano;ciclano;0 4;beltrano;beltrano;0 5;foo;foo;0 8;jose;jose;0 9;maria;maria;0 and the code is var linha,uid,login,senha,email,tipo : WideString; resposta : TStringList; I : Integer; begin try resposta := TStringList.Create; resposta.Text := frmMain.IdHTTP1.Get(frmMain.cdsConfig

Evaluate Email with Indy 10 and DELPHI

时光怂恿深爱的人放手 提交于 2019-12-18 06:51:58
问题 I use the following code to eval the msg. content (body / lines) of an E Mail msg received with the INDY 10 components function LinesFromMsg(aMsg: TIdMessage): TStrings; var i: Integer; begin for i := 0 to aMsg.MessageParts.AttachmentCount-1 do begin if (amsg.MessageParts.Items[i].ContentType ='HTML') then begin if (amsg.MessageParts.Items[i] is Tidtext) then Result := TidText(amsg.MessageParts.Items[i]).body; end; end; end; regarding this code I have 2 questions : a) is this the correct way

How can I use NTLM authentication in a Delphi SOAP Web Service client?

纵饮孤独 提交于 2019-12-18 04:27:07
问题 For a Microsoft CRM project, we need NTLM authentication in the Delphi 2009 web service client. It looks like Indy 10 Tiburon already has experimental NTLM support. How can I activate the NTLM authentication for the THTTPRio component and use the logon information (user name, password, domain) of the destination web service server? Edit: it would also be helpful if there is a way to use other authentication methods than 'Basic', for example HTTP Digest access authentication. 回答1: In the user

TIdHTTP and TLS SNI doesnt work

 ̄綄美尐妖づ 提交于 2019-12-17 20:52:29
问题 On my attempt the TLS SNI extension is missing. I don't know why. Can someone point me in the right direction? Embarcadero® RAD Studio 10 Seattle Version 23.0.21418.4207 Indy version: 10.6.2.5311 OpenSSL: https://indy.fulgan.com/SSL/openssl-1.0.2h-i386-win32.zip The (WireShark) result is the same with and without the workaround. Example/demonstration code: unit CMTelekomTest; ... var IdHTTP1: TIdHTTP; IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL; xml: ixmldocument; root, node,

How to make Indy OpenSSL compatible with most servers

允我心安 提交于 2019-12-17 20:13:22
问题 I use the following code to setup SSLHandler for POP3/SMTP sending/receiving app: IdSSLHandler->SSLOptions->Mode = sslmClient; IdSSLHandler->SSLOptions->Method = slvSSLv23; IdSSLHandler->SSLOptions->SSLVersions = TIdSSLVersions() << sslvSSLv3 << sslvTLSv1 << sslvTLSv1_1 << sslvTLSv1_2; So, the above code is supposed to support SSL 3, TLS 1, TLS 1.1 and TLS 1.2 automatically. This does not work well and reports "wrong version" error. When the SSLVersions line is removed then it works but by

How to build stand-alone SOAP web services using Delphi?

落花浮王杯 提交于 2019-12-17 19:49:48
问题 How can I build a stand-alone SOAP-based Web Services using Delphi? Must work with Delphi 2009, but it'd be nice if it worked with older ones too. The built-in WebBroker Web Services creates CGI or ISAPI. It would be nice to create a stand-alone executable that I can control from bottom to top, especially during development. 回答1: RemObjects SDK for Delphi (RO/Delphi). Different messaging formats are provided, including our own highly efficient binary BinMessage format, as well as support for