Solved

INDY / Delphi assign IdHTTP

Posted on 2010-11-16
1
750 Views
Last Modified: 2012-05-10
I'm writing a multi threaded application with Indys idHttp. To work the cookies (and perhaps more)  from the base object must be present in the other threads. Fine, I thought and tried the "assign" method. But the result was an error:

Cant assign a idHttp to a HTtp ... So what i need is to copy the properties of one IdHTTP to another.
0
Comment
Question by:Sunsales
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 500 total points
ID: 34151836

Create a class helper and use it to copy the properties

type
  TIdHTTPHelper = class(TObject)
  public
    class procedure Assign(ASource, ADestination: TIdHTTP);
  end;

implementation

{ TIdHTTPHelper }

class procedure TIdHTTPHelper.Assign(ASource, ADestination: TIdHTTP);
begin
  ADestination.MaxAuthRetries := ASource.MaxAuthRetries;
  ADestination.AllowCookies := ASource.AllowCookies;
  //Add other properties you need
  ..........
end;

you can just call it as
TIdHTTPHelper.Assign(idHTTP1, idHTTP2);
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question