indy10

Seeking simple INDY demo [closed]

非 Y 不嫁゛ 提交于 2019-12-05 06:02:34
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 7 years ago . I want a simple client server communication which I can use an underlying framework and never have to look at again. I want to concentrate on my application and have a simple functional API along the lines of: SendStringFromClentToServer() : String; // Returns the server result string // or "" on etror (or throws

Indy's TIdHTTPProxyServer: How to filter requests?

风流意气都作罢 提交于 2019-12-05 02:06:29
问题 I'm using an TIdHTTPProxyServer to implement a simple HTTP proxy, but I'd like now to block some connections if they match certain URLs. Which event and/or component is best to accomplish that? Indy documentation is not too explicative. :( Thanks! 回答1: As a basic filter you can use the OnHTTPBeforeCommand event handler (which fires before the command is sent to the HTTP server). Inspect the Context parameter properties, you'll find useful: Context.Command Context.OutboundClient.Host Context

How can I download a huge file via TIdHTTP?

六眼飞鱼酱① 提交于 2019-12-04 12:08:27
I use this code to download small files: Var ms:TMemoryStream; begin ms:=TMemoryStream.Create; Idhttp1.get('http://mydomain.com/myfile.zip',ms); ms.SaveToFile('myfile.zip'); ms.Free; end; But file is saved in RAM before storing to disk, so it may be difficult to download files >1Gb, for example. Is there a way to download a file by its parts? Or do I need to use the WinInet? Thanks in advance! Rob Kennedy TMemoryStream provides an in-memory buffer, so if you download into one, you need to have enough memory to hold everything you receive. It's not the only kind of stream, though. You can pass

Incorrect boundary string in multipart/mixed message

旧城冷巷雨未停 提交于 2019-12-04 08:27:48
I'm using Delphi 2006 to create and send an email message with an attachment in a personal-use-only application. I send the message with an instance of TIdSMTP, and then also put a copy into a specific IMAP folder with an instance of TIdIMAP4. This all works very nicely with the version of Indy 10 that was distributed with BDS2006, with one exception: the time is always incorrect in the email header. I decided to fix that if I could, and after searching for a solution it seemed most reasonable to get the latest Indy 10 snapshot and use that. That puts the correct time into the email header,

IdHTTP.get returning HTTP1.1/ 403 Forbidden

痴心易碎 提交于 2019-12-04 03:38:09
问题 I'm trying to access an update.txt file on my website, using a DelphiXE compiled program and the IdHTTP component. The code I'm using is as follows: procedure TFormAbout.SpeedButtonUpdateClick(Sender: TObject); function CheckUpdates: String; var lIdHttp: TIdHTTP; begin lIdHttp := TIdHTTP.Create(nil); result := lIdHttp.Get('http://www.test.com/test_down_load/update.txt'); end; var sWebVersion: String; sVersionList: TStringList; begin try sWebVersion := Checkupdates; except on E: Exception do

Adding custom header to TIdHttp request, header value has commas

↘锁芯ラ 提交于 2019-12-04 03:20:49
I'm using Delphi XE2 and Indy 10.5.8.0. I have an instance of TIdHttp and I need to add a custom header to the request. The header value has commas in it so it's getting parsed automatically into multiple headers. I don't want it to do that. I need the header value for my custom header to still be one string and not split based on a comma delimiter. I have tried setting IdHttp1.Request.CustomHeaders.Delimiter := ';' with no success. Is there a way to make sure the header doesn't get split up? procedure SendRequest; const HeaderStr = 'URL-Encoded-API-Key VQ0_RV,ntmcOg/G3oA==,2012-06-13 16:25:19

Indy TIdHTTP URI with login/password not working

让人想犯罪 __ 提交于 2019-12-03 22:28:04
I'm writing an HTTP API wrapper to integrate with particular IP Cameras . Part of the process requires login credentials in the URI, for example: http://user:pass_with_#_sign@address:port/somespecificpath/ I'm using Indy's TIdHTTP.Get to send the request to the device. However, the password consists of a '#' character. If this URI is placed in any browser with the plain password, the # character throws it off. Therefore, I need to encode the password's # to %23 ... http://user:pass_with_%23_sign@address:port/somespecificpath/ When I paste this URI into any browser, it successfully logs in and

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

posting a file as part of a form

走远了吗. 提交于 2019-12-02 19:39:29
问题 I am trying to post a file and some other data to a website in an App that I am writing using Delphi XE8 but it is not working. When I monitor the network traffic using "Microsoft Network Monitor 3.4", the file is only partially sent and none of the other data is sent. I have tried both Indy 10 and the new TNetHTTPClient and got the same result which tells me I am doing something wrong. please help. Indy Way procedure TMyClass.SendFile(aUrl: String); var mCookies: TIdCookieManager; pHttp:

Send email using indy component delphi xe2 SSL negotiation faild

ⅰ亾dé卋堺 提交于 2019-12-02 07:20:12
问题 I tried with Indy component to send email in XE2, and it works fine on my laptop that I compiled my project on. But if I take my exe project to another PC, it shows an error message Connection closed gracefully or, sometimes I get SSL Negotiation failed Actually I tried many times to solve my problem, but I can't. This is my code - where is my mistake? I need a practical solution. procedure Gmail(username, password, totarget, subject, body :string); var DATA : TIdMessage; SMTP : TIdSMTP; SSL