indy

How to add/overwrite a HTTP header using THTTPReqResp?

99封情书 提交于 2019-12-04 01:43:02
问题 I want to approach the Exchange EWS webservice and handle XML SOAP composition (request) and parsing (response) myself. Therefore, THTPPRIO seems a bit overkill. I'm trying THTTPReqResp, but I'm stuck here: The web service does not follow the specs and expects a Content-Type: text/xml; charset=utf-8 instead of Content-Type: text/xml; charset="utf-8" How can I add/overwrite a header using THTTPReqResp? Here's the code so far: HTTPReqResp1.SoapAction := '"http://schemas.microsoft.com/exchange

Resume HTTP Post/upload with Indy

拜拜、爱过 提交于 2019-12-03 17:11:08
I'm trying to resume an upload using indy (HTTP Post), the code looks like this (using Delphi 2010, Indy 10.4736): IdHttp.Head('http://localhost/_tests/resume/large-file.bin'); ByteRange := IdHttp.Response.ContentLength + 1; // Attach the file to post/upload Stream := TIdMultipartFormDataStream.Create; with Stream.AddFile('upload_file', 'D:\large-file.bin', 'application/octet-stream') do begin HeaderCharset := 'utf-8'; HeaderEncoding := '8'; end; // with with IdHTTP do begin IOHandler.LargeStream := True; with Request do begin ContentRangeStart := ByteRange; ContentRangeEnd := (Stream.Size -

How do I send e-mail using Gmail's SMTP and Indy 10?

谁说胖子不能爱 提交于 2019-12-03 16:03:53
I'm using Delphi 2009 and the lastest Indy 10 from svn to send e-mails using SMTP, but it doesn't work with Gmail (Google Apps hosted domain). When I try to send an e-mail I get "Must issue a STARTTLS command first". I tried Googling about it and I found several forums and several solutions, but they all just bashed some code or just said I needed an OpenSLL DLL, which so far isn't very clear to me exactly what I need. Can someone please tell exactly which DLL I need and what do I have to change in the my TIdSMTP and TIdMessage objects in order to send the e-mails through Gmail's SMTP server?

Problem with Indy IdHttp Post in Delphi 2010

一世执手 提交于 2019-12-03 16:01:56
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/sXML'; IdHttp.Request.Connection := 'Keep-Alive'; IdHttp.Request.ContentLength := Length(sXML);

Delphi: Indy TIdTCPClient Reading Data

江枫思渺然 提交于 2019-12-03 15:04:45
问题 I am using Delphi 2007 & Indy 10; I am a bit of a Delphi noob so apologies if I have missed something obvious... Background: I have a simple server app which simply sends the word "PING" when you connect to its port. It will also respond if it receives the word "PONG". This is working fine, I have manually tested this using netcat/wireshark. I am trying to code my client to connect to the port and automatically respond to the word PING whenever it receives it. I have created a simple form

SSL support for smtp.live.com and TIdSmtp (Indy, Delphi)

寵の児 提交于 2019-12-03 13:10:12
I am trying to connect to smtp.live.com to send emails (live.com supports free pop3/smtp since 2009 apparently but this is totally news for me). Here is what happens when I try to connect to smtp.live.com port 587: Method sslvSSLv2 - timeout (obviously the server does not support SSL2) Method sslvSSLv3 - Error connecting with SSL. - error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number Method sslvSSLv23 - Error connecting with SSL. - error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol Method sslvTLSv1 - Error connecting with SSL. - error:1408F10B:SSL routines:SSL3

How can I update HTML pages dynamically with Indy HTTP server using jQuery and “Long Polling”?

痴心易碎 提交于 2019-12-03 13:06:20
问题 I have read the article Simple Long Polling Example with JavaScript and jQuery. The paragraph "Long Polling - An Efficient Server-Push Technique" explains that the Long Polling technique combines the best-case traditional polling with persistent remote server connections. The term Long Polling itself is short for long-held HTTP request. How can I implement a Indy based HTTP server which uses Long Polling? 回答1: Here is a self-contained example project, tested with Indy version 10.5.9 and

Use SSL with Delphi yet still having a single exe

流过昼夜 提交于 2019-12-03 12:58:09
问题 We use Indy and we need SSL eMail support in our app., however we need to have our application in a single .Exe. We know that the default Indy handler requires to have the dlls in the path. Extracting the Dlls from one of the EXE's resources would be the last resort. Any better ideas? 回答1: Try SSLBlackBox. 回答2: TOndrey gave you a good answer. I use SecureBlackBox as well. You may consider some other third party components: StreamSec SecureBridge from DevArt 回答3: Be aware: if you add SSL/TLS

MultiCast Messages to multiple clients on the same machine

巧了我就是萌 提交于 2019-12-03 12:08:55
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... Ive managed to get it to work with IP Multi Cast with one client per machine, but even after many trys

Indy 10 - IdSMTP.Connect raising “Could not load SSL library.”

拈花ヽ惹草 提交于 2019-12-03 10:48:40
Here is my configuration: IdSMTP1.Host := 'smtp.gmail.com'; IdSMTP1.Port := 587; IdSMTP1.UseTLS := utUseExplicitTLS; IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1; IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1; I've downloaded the OpenSSL from here , both libeay32.dll and ssleay32.dll are in the same folder of my application. The Indy version is: 10.0.52 The following command is working on my machine: telnet smtp.gmail.com 587 How to properly connect in a TLS enable SMTP server, in my case Gmail, using Indy? It seems like IdSSLOpenSSLHeaders.Load could not find the address to