idhttp

Delphi TIdHTTP POST does not encode plus sign

孤者浪人 提交于 2019-12-11 03:18:21
问题 I have a TIdHTTP component on a form, and I am sending an http POST request to a cloud-based server. Everything works brilliantly, except for 1 field: a text string with a plus sign, e.g. 'hello world+dog', is getting saved as 'hello world dog'. Researching this problem, I realise that a '+' in a URL is regarded as a space, so one has to encode it. This is where I'm stumped; it looks like the rest of the POST request is encoded by the TIdHTTP component, except for the '+'. Looking at the

Slow responses to TIdHTTP POSTs

旧时模样 提交于 2019-12-11 02:17:58
问题 I am investigating a problem with a legacy executable, written in Delphi 5, utilising Indy 9. Components in use: TIdHTTP, TIdConnectionIntercept & TIdSSLIOHandlerSocket. The problem the app is presently experiencing is slow responses to TIdHTTP POSTs. I found the following two links: Delphi: Why does IdHTTP.ConnectTimeout make requests slower? Delphi TIdHTTP POST is very slow vs GET Based on the links, I have tried the suggestions of: (i) setting ConnectTimeout to zero and (ii) setting the

Delphi: Setting connection timeout for TIdHttpServer

妖精的绣舞 提交于 2019-12-10 11:07:18
问题 Using TIdHTTPServer (Indy 10.6), i want set a connection timeout for close slow or inactive client (client are common browser) and close all zombie connection after 60 seconds of inactivity. I have found Socket.ReadTimeout in TIdContext.Connection. Is this the right way? TIdHTTPServer already perform this (it seem have infinite timeout)? WebServer := TIdHTTPServer.Create(nil); WebServer.SessionState := false; WebServer.KeepAlive := false; WebServer.OnCommandGet := CustomOnCommandGet;

delphi idhttp post related question

ε祈祈猫儿з 提交于 2019-12-08 10:44:19
问题 im new to delphi. and also almost new to programming world. i was made some simple post software which using idhttp module. but when execute it , it not correctly working. this simple program is check for my account status. if account login successfully it return some source code which include 'top.location =' in source, and if login failed it return not included 'top.location =' inside account.txt is follow first and third account was alived account but only first account can check, after

how to convert idhttp downloaded image from extention to another?

会有一股神秘感。 提交于 2019-12-06 12:57:15
问题 i have this Thread that get image url from the web then save it to memory stream then save from memory stream To file i needed to convert any image that downloaded to a gif image so i do something like this unit downloadimgThread; interface uses Windows, SysUtils, Classes, dialogs, IdSSLOpenSSL, IdHttp, IdUri, System.AnsiStrings, Graphics, Jpeg, Vcl.Imaging.GIFImg, PNGImage; type TDownloadUpdateVisualEvent = procedure(Sender: TObject; Anameofimg: String; var Aimagelocate: String) of object;

Delphi: TIdHTTP vs TNetHTTPClient

℡╲_俬逩灬. 提交于 2019-12-06 05:42:13
I'm writing a download manager in Delphi with some custom features like resumable downloads and downloading through proxies. I'm studing different component solutions: Indy and NetHTTP, both seem very close. TNetHTTPClient seem to be an interface of winhttp.dll . TIdHTTP seem to be an interface of wininet.dll (but i'm not sure). TIdHTTP seems like a very old component (maybe very stable/tested) and has tons of documentation online. TNetHTTPClient seems to be a very recent component, and doesn't have good documentation online. I'm a bit undecided... which one to choose? The point is: what is

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

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

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

Delphi: Using Google URL Shortener with IdHTTP - 400 Bad Request

半城伤御伤魂 提交于 2019-12-03 16:39:52
I'm trying to access the URL Shortener ( http://goo.gl/ ) via its API from within Delphi. However, the only result I get is: HTTP/1.0 400 Bad Request (reason: parseError) Here is my code (on a form with a Button1 , Memo1 and IdHTTP1 that has IdSSLIOHandlerSocketOpenSSL1 as its IOHandler. I got the necessary 32-bit OpenSSL DLLs from http://indy.fulgan.com/SSL/ and put them in the .exe's directory): procedure TFrmMain.Button1Click(Sender: TObject); var html, actionurl: String; makeshort: TStringList; begin try makeshort := TStringList.Create; actionurl := 'https://www.googleapis.com/urlshortener