Usability improvement to kCurlHelper class

3 views
Skip to first unread message

Alexander Obuhovich

unread,
Feb 5, 2011, 9:12:27 AM2/5/11
to In-Portal Development
In-Portal has kCurlHelper class to automate process of retrieving data from other API's or websites, like Google Data API or RSS feeds.

All works fine, when queried website has no errors. In case if website sends 500 HTTP response code (error) or there will be a connection timeout to that site, then response from kCurlHelper::Send method will be the same: empty string.

Such result is not sufficient for web sites, where empty string means something special response. In such cases I usually check for last HTTP code to be 200 OK and no connection error has occurred.

In attached patch there is new kCurlHelper::isGoodResponce method for doing all that.


Ready for testing.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
curl_responce_checker.patch

Dmitry A.

unread,
Feb 5, 2011, 4:42:31 PM2/5/11
to in-por...@googlegroups.com
Thanks Alex, tested good.

DA
Reply all
Reply to author
Forward
0 new messages