[Gambas-user] HttpClient not exposing redirect response codes

T Lee Davidson t.lee.davidson at ...626...
Fri Apr 28 18:59:10 CEST 2017


On 04/27/2017 03:01 AM, Benoît Minisini wrote:
> Le 25/04/2017 à 19:12, T Lee Davidson a écrit :
>> I have run into a couple of sites that are responding with 301 (Moved
>> Permanently) and 302 (Moved Temporarily) codes. However, HttpClient.Code
>> yields "0" for both of those sites/codes (and HttpClient.Reason is
>> empty). 200 & 404 codes are reported successfully.
>>
>> Have I missed something in the properties that is preventing proper
>> disclosure of redirect response codes?
>>
>> Or is this a bug?
>>
>> (Project attached.)
>>
>
> I have just tested your project, and I get all the expected answers
> (301, 302, 404 & 200).
>
> libcurl (the library used by gb.net.curl) has a flag to automatically
> follow http redirections, but it is disabled by default.

I thought so. But, I looked and looked and did not find any way to access that flag either in HttpClient or in Curl (gb.net.curl).


> So I don't understand the result you have. Which version of libcurl do
> you use on your system?
>

The version of libcurl on my system is libcurl4, Version 7.37.0-16.3.1 (libcurl.so.4.3.0).

BTW, I just tried again to see if it was just a transient issue, but, no, I still get neither 301 nor 302.


---
Lee






More information about the User mailing list