?
Solved

INDY / Delphi assign IdHTTP

Posted on 2010-11-16
1
Medium Priority
?
762 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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

770 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