testcurl.pp 904 B

123456789101112131415161718192021222324252627282930313233
  1. {
  2. $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $
  3. This file is part of the Free Pascal packages.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$H+}
  13. program testcurl;
  14. uses libcurl;
  15. Var
  16. URL : Pchar = 'http://www.freepascal.org';
  17. hCurl : pCurl;
  18. begin
  19. hCurl:= curl_easy_init;
  20. if Assigned(hCurl) then
  21. begin
  22. curl_easy_setopt(hCurl,CURLOPT_VERBOSE, [True]);
  23. curl_easy_setopt(hCurl,CURLOPT_URL,[URL]);
  24. curl_easy_perform(hCurl);
  25. curl_easy_cleanup(hCurl);
  26. end;
  27. end.