indy

Delphi Indy IdHTTP Authorization

你说的曾经没有我的故事 提交于 2019-12-11 12:43:29
问题 I'm trying to get user photos in Exchange using IdHTTP through REST API How to: Get user photos by using EWS in Exchange procedure TsMain.IdHTTP1Authorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean); begin Authentication.Username := DomainName +'\'+ User; Authentication.Username := User + #64 + DomainName; Authentication.Password := Password; Handled:=true; end; function TsMain.GetUserPhoto(const eMail: string):Boolean; var s: TStream; ResponseCode: Integer;

Indy Get response text while not handling 302

强颜欢笑 提交于 2019-12-11 12:32:19
问题 FHTTP.HandleRedirects := False; try StrPage := FHTTP.Get('https://somesite.site'); except end; There is redirect 302 , but i need to get text from this reqest.. Response: (Status-Line):HTTP/1.1 302 Found Cache-Control:no-cache, no-store Content-Length:148291 Content-Type:text/html; charset=utf-8 Date:Sun, 21 Sep 2014 09:13:49 GMT Expires:-1 Location:/di Pragma:no-cache In response : <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="/di">here</a>.</h2> </body><

How do I support TLS 1.x only (in my webservice)?

為{幸葍}努か 提交于 2019-12-11 10:48:59
问题 I'm trying to control what TLS/SSL protocols are supported for a HTTPS connections to my webservice, by using a TIdServerIOHandlerSSLOpenSSL component and setting its SSLOptions.Method and SSLOptions.SSLVersions properties (as suggested in this answer). The default is Method sslvTLSv1 and SSLVersions [sslvTLSv1] (see this answer for the relations between Method and SSLVersions): I use nmap with the ssl-enum-ciphers.nse script from this answer to check what is actually available, and get this

How to read response from Indy IdHTTP get

帅比萌擦擦* 提交于 2019-12-11 10:38:23
问题 I have written code to use get with indy IdHTTP component var get_url: string; resp: TMemoryStream; begin get_url := 'http://localhost/salesapp/is_run.php?ser='; resp := TMemoryStream.Create; IdHTTP1.Get(get_url+'v', resp); memo1.Lines.LoadFromStream(resp); This url http://localhost/salesapp/is_run.php?ser=v return JSON response but I dont know how to read it from Delphi. 回答1: When Get() exits, the stream's Position is at the end of the stream. You need to reset the Position back to 0 before

Why do I get compiler errors using Delphi 2010's built-in Indy distribution?

廉价感情. 提交于 2019-12-11 10:00:22
问题 I have just installed Delphi 2010 and got some troubles with idHTTP component. If I drop it on form and try to compile, Delphi says that: [DCC Error] IdCookieManager.pas(118): E2010 Incompatible types: 'TIdCookieList' and 'TIdCookieDomainList' [DCC Error] IdCookieManager.pas(172): E2003 Undeclared identifier: 'IsValidCookie' [DCC Error] IdCookieManager.pas(236): E2010 Incompatible types: 'TIdCookieList' and 'TIdCookieDomainList' [DCC Fatal Error] Unit4.pas(7): F2063 Could not compile used

Retrieve Gmail Labels with Indy?

♀尐吖头ヾ 提交于 2019-12-11 09:44:32
问题 According to this thread (and various hints in the source code like variable names) Indy supports fetching gmail labels but not setting or removing them. However, as of yet, this functionality appears to be undocumented. Can anyone help me with filling in the details about how to retrieve Gmail labels with Imap? Which function(s) should I call to retrieve the labels and have Indy parse out the results for me? Although I could certainly manually call SendCmd() to request the labels ('C2 UID

Using PayPal REST client with Delphi XE2

两盒软妹~` 提交于 2019-12-11 09:32:07
问题 I am trying to interface with the PayPal REST client, following the instructions here: https://developer.paypal.com/docs/integration/direct/make-your-first-call/ I can successfully obtain the access token using a TIdHttp component with this code: http.Request.ContentType := 'application/x-www-form-urlencoded'; http.Request.Accept := 'application/json'; http.Request.AcceptLanguage := 'en_US'; http.Request.BasicAuthentication := True; http.Request.Username := 'my paypal clientid'; http.Request

Need Delphi 6 example for updating a progress bar during TIdSmtp send operation, especially for large attachments

限于喜欢 提交于 2019-12-11 08:23:28
问题 I am using the Indy TIdSmtp component to send E-mails. The E-mails I am sending will have a large attachment, usually in the range of 5 to 40 MB. I want to update a progress bar that will show the overall progress of the send as a percentage of the total number of bytes that need to be sent. I don't care if it's really precise, just good enough to give someone watching the progress bar an indication for how far along the overall E-mail sending process is. Can someone point me to a code sample

Delphi 5 Indy/ics SSL workaround?

跟風遠走 提交于 2019-12-11 07:10:47
问题 I'm getting errors like: "IndyProtocols5 does not use or support IdSSLOpenSSLHeaders.." when attempting to install Indy 9 or 10 with my Delphi5 and notice it is a problem for others. This causes the exception: "Could not load SSL library" when using IdHttp.IOHandler. The applications I have inherited include so many unsupported D5 components, upgrading to D6+ is unfortunately beyond my skillset. I want to initially use Indy for posting and downloading CSV, but potentially calling web services

Access Violation when i drop a TidSMTP on a Form

。_饼干妹妹 提交于 2019-12-11 06:54:41
问题 i've a problem with Delphi XE4: when i drop on a form an TIdSmtp or TIsSSLIOHandlerSocketOpenSSL i receive this error: [511EDABF]{IndySystem180.bpl} IdStack.TIdStack.IncUsage (Line 688, "IdStack.pas" + 11) + $7 [511EEBB2]{IndySystem180.bpl} IdComponent.TIdComponent.InitComponent (Line 229, "IdComponent.pas" + 1) + $5 [50EE84A2]{IndyCore180.bpl} IdTCPConnection.TIdTCPConnection.InitComponent (Line 912, "IdTCPConnection.pas" + 1) + $2 [50EE0D99]{IndyCore180.bpl} IdTCPClient.TIdTCPClientCustom