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 8042919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:44:40+00:00 2026-06-05T04:44:40+00:00

With the following code, I get exception class EIdHTTPProtocolException with message ‘HTTP/1.1 403 Forbidden’.

  • 0

With the following code, I get exception class EIdHTTPProtocolException with message ‘HTTP/1.1 403 Forbidden’. Process svchostip.exe (11172)

function GetInternetIP:string;
var
  IdHTTPMainUrl : TIdHTTP;
begin
  try
    IdHTTPMainUrl := TIdHTTP.Create(nil);
    IdHTTPMainUrl.Request.Host := 'http://www.whatismyip.com/automation/n09230945.asp';
    Result := idHTTPMainUrl.Get('http://automation.whatismyip.com/n09230945.asp');
  except
    IdHTTPMainUrl.Free;
  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-05T04:44:41+00:00Added an answer on June 5, 2026 at 4:44 am

    You need to set your user agent, this is documented in WhatIsMyIP faq:

    •Please set your program’s user agent to Mozilla/5.0 (Windows NT 6.1;
    WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 , this will keep your
    program from being blocked by CloudFlare

    Also freeing the TIdHTTP instance should be unconditional, you’re only freeing it when an exception is thrown. Use exception handling, well, to handle exceptions.

    function GetInternetIP:string;
    var
      IdHTTPMainUrl : TIdHTTP;
    begin
      IdHTTPMainUrl := TIdHTTP.Create(nil);
      try
        IdHTTPMainUrl.Request.UserAgent :=
          'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0';
        Result := idHTTPMainUrl.Get('http://automation.whatismyip.com/n09230945.asp');
      finally
        IdHTTPMainUrl.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running the following code, I get an exception: using (var client = new Pop3Client())
When I run the following code, I get the exception below: ''# NOTE: ExcelApp
I get an exception while executing following piece of code bool FieldValueMessage::Get(const std::string &field,
For the attached code, I get the following compile time error : exception during
I was suprised when found that the following code throws exception at runtime: class
The following code public class GenericsTest2 { public static void main(String[] args) throws Exception
Why does the following code get the runtime error: Members of the Triggers collection
I have the following code: // GET: /PlayRoundHole/Create public ActionResult Create(int id) { DB
I have the following code to get some records from db $criteria = new
I used following code to get response from JSON response. It working very nicely

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.