indy

Problem with Indy IdHttp Post in Delphi 2010

99封情书 提交于 2019-12-04 23:54:06
问题 I have problem with Indy IdHttp Post method. Function CallRpc() compiled with Delphi 2007 works fine but same code compiled with Delphi 2010 raises exception. What do I have to consider when I change Delphi 2007 Indy TIdHttp to Delphi 2010 Indy TIdHttp? function CallRpc(const sURL, sXML: string): string; var SendStream : TStream; IdHttp : TIdHttp; begin SendStream := TMemoryStream.Create; IdHttp := TIdHttp.Create(nil); try IdHttp.Request.Accept := '*/*'; IdHttp.Request.ContentType := 'text

Delphi Indy verify server certificate SSL

你说的曾经没有我的故事 提交于 2019-12-04 21:45:11
问题 I have scoured the internet and haven't found a solution or method on how to verify the certificate when connecting over HTTPS using TIdHTTP. I have hooked up a IdSSLIOHandlerSocketOpenSSL component as the IOHandler, set the SSLModes, etc. but when I browse to https://s3.amazonaws.com it cannot verify the certificate. OpenSSL (Indy) gives "Error connecting with SSL. SSL3_GET_SERVER_CERTIFICATE: Certificate verify failed" The OpenSSL libraries have successfully loaded (checked with

Delphi: Why does IdHTTP.ConnectTimeout make requests slower?

爱⌒轻易说出口 提交于 2019-12-04 21:12:07
问题 I discovered that when setting the ConnectTimeoout property for a TIdHTTP component, it makes the requests (GET and POST) become about 120ms slower? Why is this, and can I avoid/bypass this somehow? Env: D2010 with shipped Indy components, all updates installed for D2010. OS is WinXP (32bit) SP3 with most patches... My timing routine is: Procedure DoGet; Var Freq,T1,T2 : Int64; Cli : TIdHTTP; S : String; begin QueryPerformanceFrequency(Freq); Try QueryPerformanceCounter(T1); Cli := TIdHTTP

MultiCast Messages to multiple clients on the same machine

冷暖自知 提交于 2019-12-04 19:54:22
问题 Im trying to write a server/service that broadcasts a message on the lan ever second or so, Kind of like a service discovery. The message needs to be received by multiple client programs that could be on the same machine or different machines. But there could be more than one program on each machine running at the same time. Im using delphi7, with indy 9.0.18 where im stuck is if i should be using UDP(TIdUDPClient/Server) or IP MultiCast (TIdIPMCastClient/Server) or if its even possible...

Post a file through https using indy / delphi components

自作多情 提交于 2019-12-04 16:04:49
I'm trying to upload a file through https by using Indy components in delphi. Here is my code: HTTP := TIdHTTP.Create(Self) IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create; HTTP.Request.Host := RemoteHost; HTTP.Request.Connection := 'keep-alive'; HTTP.Request.Accept := 'multipart/mixed'; HTTP.IOHandler := IOHandler; HTTP.ConnectTimeout := 0; HTTP.ReadTimeout := 0; //### CREATE FILE TO SEND TestStream := TIdMultipartFormDataStream.Create; try //### POST PARAMETERS TestStream.AddFormField('ReceiverId','LOOPTEST'); TestStream.AddFormField('FileType','LOOPBACK'); //### ADD FILE TestStream.AddFile

How to Implement uPnP on Delphi XE2

99封情书 提交于 2019-12-04 15:13:12
I have a Http server implemented using indy TidHTTPServer on Delphi XE2. This product is mostly used for intranet, however sometimes it is needed to be accessed from internet also. The target customers are small companies, and for this PnP capabilities is a must. For internal use this server uses the current IP from the server and try to assign the port 8888. I want to discover a wandevice on the network that can let me ask for port routing. I am not sure port routing is the best solution either, I am not familiar with the possibilities. However I prefer the most widely available possibilities

Delphi XE: idHttp & Request.Range, a bug?

时光毁灭记忆、已成空白 提交于 2019-12-04 15:08:30
I have Delphi XE. I try to set Request.Range of idHttp but I cannot do this. Delphi doesn't allow me to do this neither at design time nor at run time. E.g. I set '6000-' in a design time -> a property gets empty all time. I do (in a thread): Downloader.Request.Range:=(IntToStr(DFileStream.Position) + '-'); synchronize(procedure begin showmessage(Downloader.Request.Range) end); showmessage(Downloader.Request.Range) shows me nothing (an empty string). I checked a request in HTTPAnalyzer -> my program doesn't send a range. A checked this behavior in Delphi 2010 - all is normal . I set a range in

How to do NTLM Authentication using Indy 10 in Delphi 7?

二次信任 提交于 2019-12-04 12:57:30
I want to do NTLM Authentication with Indy 10 Components in Delphi 7 . Here is my source code : uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs ,StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,IdAuthenticationSSPI , IdAuthentication , IdAuthenticationDigest , IdHeaderList; procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Lines.add( IdHTTP1.Get('http://www.google.co.in')); end; procedure TForm1.IdHTTP1ProxyAuthorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean); var UserName: string;

Is TIdHTTPServer Compatible with Microsoft BITS

谁说我不能喝 提交于 2019-12-04 11:25:15
问题 We are trying to write an update server for our software using the TIdHTTPServer component. Currently we are serving an XML file that lists the available updates and their file versions etc.., when the client program finds a updated version it should start to download it using BITS. Now this is where we have a problem, our programs are requesting the XML file and seeing there is an update available. It then creates a BITS job to download it, however BITS keeps reporting that the download

TIdHttp.Post - can't get utf-8 encoding

 ̄綄美尐妖づ 提交于 2019-12-04 07:51:50
How can I force TIdHttp.post method to return the web page encoded in utf-8? I tried http.Request.ContentEncoding := 'UTF-8' but it doesn'twork. Here's my code: procedure TeUpdateNews.Check; var url: string; Http: TIdHttp; SS: TStringStream; param: TStringList; SWIDESTRING: WideString; begin http := TIDHttp.Create(nil); http.HandleRedirects := true; http.ReadTimeout := 5000; http.Request.ContentEncoding := 'UTF-8'; param := TStringList.create; param.Clear; url := CONST_SOME_WWW; try SS := TStringStream.Create; try SWIDESTRING := http.Post(url, param); // it's not getting utf-8! ShowMessage