Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8810051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:01:45+00:00 2026-06-14T03:01:45+00:00

I am trying to intercept GET/POST that i get from IdHTTPProxyServer and send it

  • 0

I am trying to intercept GET/POST that i get from IdHTTPProxyServer and send it to IdHTTP so i can replicate the GET/POST and eventually get cookies so I can login in to any website.

How can this be improved? If i try to execute this code it crashes.

procedure TForm1.IdHTTPProxyServer1HTTPDocument(
  AContext: TIdHTTPProxyServerContext; var VStream: TStream);
begin

if AContext.Command='POST' then begin
EmbeddedWB1.LoadFromString(IdHTTP1.Post(AContext.Target,AContext.Headers.Text)); << CRASH
end;

if AContext.Command='GET' then begin
EmbeddedWB1.LoadFromString(IdHTTP1.Get(AContext.Target)); << CRASH
end;

end; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:01:46+00:00Added an answer on June 14, 2026 at 3:01 am

    When using the OnHTTPDocument event, you need to look at the TIdHTTPProxyServerContext.TransferSource property to know if the event is being triggered for a client request that contains body data, or is being triggered for the target server’s response to the client request. Sending your own GET/POST request only makes sense when processing client requests, however the OnHTTPDocument event is not likely to ever be triggered for a GET request since there is no body data to capture.

    You don’t need to use TIdHTTP in order to get the server’s cookies. Let TIdHTTPProxyServer do its work normally, and then you can extract the cookies from the TIdHTTPProxyServerContext.Headers property in the OnHTTPResponse event, eg:

    procedure TForm1.IdHTTPProxyServer1HTTPResponse(AContext: TIdHTTPProxyServerContext);
    var
      Cookies: TStringList;
    begin
      Cookies := TStringList.Create;
      try
        AContext.Headers.Extract('Set-Cookie', Cookies);
        // use Cookies as needed, such as:
        // URI := TIdURI.Create(AContext.Target);
        // try
        //   CookieManager1.AddServerCookies(Cookies, URI);
        // finally
        //   URI.Free;
        // end;
      finally
        Cookies.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get my datatable to take a POST JSON output from
I'm trying to consume the json services from broadbandmap.gov so that I can display
Im trying to get a form working in Internet Explorer. I see that when
I'm trying to get an image off the internet from an URL in java.
How can I get source code off the internet using SVN? I'm trying to
I'm trying to intercept WindowsAuthenticationModule to login into application as another user, but I
I am trying to intercept form submits from webpages I dont control. My current
I took a method from this post (accepted answer code) that serializes object so
I'm trying to style a post on an internet forum that doesn't allow stylesheets,
I'm working on a WinRT app that does login to a webpage and get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.