Re: Encoding redirected error

Giganews Newsgroups
Subject: Re: Encoding redirected error
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Mon, 28 Aug 2017

Alexandre wrote:

> I am trying get a fanpage in facebook with get funcion
>
> The url is: https://www.facebook.com/353760301745210/

When I request that URL (either in TIdHTTP or a web browswer), I get an
HTTP 404 error saying the URL is no longer available.

> The facebook redirect to
>
https://www.facebook.com/Associa%C3%A7%C3%A3o-Athletica-Avareense-353760301745210/
>
> But tidhttp redirect to:
>
https://www.facebook.com/Associa????o-Athletica-Avareense-353760301745210/
>
> Why this encoding error occur?

Using the latest version of Indy (10.6.2 svn rev 5434 at the time of
this writing), I can't reproduce that issue (after faking an HTTP
response using the redirect URL you showed).  These are the two HTTP
requests that TIdHTTP sends:

GET /353760301745210/ HTTP/1.1
Host:www.facebook.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/3.0 (compatible; Indy Library)

GET /Associa%C3%A7%C3%A3o-Athletica-Avareense-353760301745210/ HTTP/1.1
Host:www.facebook.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/3.0 (compatible; Indy Library)

As you can see, the second request contains the correct resource URL.

What versions of Delphi/FreePascal and Indy are you using?  You
probably need to upgrade.

--
Remy Lebeau (Indy Team)

Replies

In response to

Encoding redirected error posted by Alexandre on Fri, 25 Aug 2017