zoukankan      html  css  js  c++  java
  • httpclient for linux demo

    httpclient for linux demo

    program DelphiScalableHttp;
    
    {$APPTYPE CONSOLE}
    
    {$R *.res}
    
    uses
      System.SysUtils,
      Grijjy.Http in '....GrijjyFoundationGrijjy.Http.pas',
      Grijjy.Uri in '....GrijjyFoundationGrijjy.Uri.pas',
      Grijjy.OpenSSL in '....GrijjyFoundationGrijjy.OpenSSL.pas',
      Grijjy.OpenSSL.API in '....GrijjyFoundationGrijjy.OpenSSL.API.pas',
      Grijjy.MemoryPool in '....GrijjyFoundationGrijjy.MemoryPool.pas';
    
    var
      Response: TBytes;
      HTTP: TgoHttpClient;
    
    begin
      try
        HTTP := TgoHttpClient.Create;
        try
          if HTTP.Get('http://www.grijjy.com', Response) then
            Writeln(TEncoding.ASCII.GetString(Response));
        finally
          HTTP.Free;
        end;
    
        // http2
        HTTP := TgoHttpClient.Create(True);
        try
          if HTTP.Get('https://nghttp2.org', Response) then
            Writeln(TEncoding.ASCII.GetString(Response));
        finally
          HTTP.Free;
        end;
    
        // wait
        Readln;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
    end.
    

      

  • 相关阅读:
    hdu2574 Hdu Girls' Day (分解质因数)
    python------logging模块
    python之异常
    python之反射
    python面向对象之封装
    python之面向对象2
    pyhton之路---面向对象
    python之路模块与包
    python常用模块
    匿名函数
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/14275416.html
Copyright © 2011-2022 走看看