TsgcHTTP2Client이벤트 › OnHTTP2Response

OnHTTP2Response 이벤트

클라이언트가 서버로부터 전체 응답(상태, 헤더, 본문)을 수신할 때 발생합니다.

구문

property OnHTTP2Response: TsgcHTTP2ClientResponseEvent;
// TsgcHTTP2ClientResponseEvent = procedure(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient; const Request: TsgcHTTP2RequestProperty; const Response: TsgcHTTP2ResponseProperty) of object

기본값

설명

OnHTTP2Response는 요청에 대한 완전한 HTTP/2 응답이 수신되면 발생합니다. Response 매개변수는 서버가 반환한 상태, 헤더 및 본문을 노출합니다. HTTP/2 헤더 목록에는 Response.Headers를, 원시 본문 바이트에는 Response.Data를, 문자열로서의 본문에는 Response.DataString을, UTF-8 문자열로서의 본문에는 Response.DataUTF8을 사용하십시오. Request 매개변수는 원래 요청을 식별하여 동일한 Connection에서 여러 미해결 스트림을 연관시킬 수 있습니다. FragmentedData가 h2fdOnlyFragmented로 설정되면 이 이벤트는 발생하지 않고 OnHTTP2ResponseFragment만 디스패치됩니다.

예제


procedure OnHTTP2ResponseEvent(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient;
  const Request: TsgcHTTP2RequestProperty; const Response: TsgcHTTP2ResponseProperty);
begin
  ShowMessage(Response.Headers.Text + #13#10 + Response.DataString);
end;

이벤트로 돌아가기