Version: 3.3.1
Loading...
Searching...
No Matches
wxWebRequestDebugLogger Class Referenceabstract

#include <wx/webrequest.h>

Detailed Description

Base class for logging debug information from web requests.

An object of a class derived from this one may be associated with a wxWebSession or wxWebSessionSync using wxWebSession::SetDebugLogger() in order to receive detailed information about the data exchanged with the HTTP server.

Once this object is associated with a session, its member functions will be called to report various events happening during the request processing.

libcurl-based backend provides the most full-featured logging, with WinHTTP backend providing only limited information and NSURLSession-based backend currently not providing any logging at all.

Since
3.3.2

Library:  wxNet
Category:  Networking

Public Member Functions

 wxWebRequestDebugLogger ()=default
 Default constructor.
 
virtual void OnInfo (const wxString &info)=0
 Called to notify about an informational message.
 
virtual void OnRequestSent (const wxString &line)=0
 Called with the request line sent to the server.
 
virtual void OnResponseReceived (const wxString &line)=0
 Called with the status line received from the server.
 
virtual void OnHeaderSent (const wxString &name, const wxString &value)=0
 Called for each header sent to the server.
 
virtual void OnHeaderReceived (const wxString &name, const wxString &value)=0
 Called for each header received from the server.
 
virtual void OnDataSent (const void *data, size_t size)=0
 Called when other data is sent to the server.
 
virtual void OnDataReceived (const void *data, size_t size)=0
 Called when other data is received from the server.
 

Constructor & Destructor Documentation

◆ wxWebRequestDebugLogger()

wxWebRequestDebugLogger::wxWebRequestDebugLogger ( )
default

Default constructor.

Member Function Documentation

◆ OnDataReceived()

virtual void wxWebRequestDebugLogger::OnDataReceived ( const void * data,
size_t size )
pure virtual

Called when other data is received from the server.

This data may be binary and encrypted when using HTTPS, so it is typically not human-readable, although it may be in some cases (e.g. when receiving a text response body).

Parameters
dataPointer to the received data buffer.
sizeSize of the received data buffer in bytes.

◆ OnDataSent()

virtual void wxWebRequestDebugLogger::OnDataSent ( const void * data,
size_t size )
pure virtual

Called when other data is sent to the server.

This data may be binary and encrypted when using HTTPS, so it is typically not human-readable, although it may be in some cases (e.g. when using a text body with HTTP POST).

This is currently only called when libcurl-based backend is used or when WinHTTP backend is used with synchronous requests.

Parameters
dataPointer to the received data buffer.
sizeSize of the received data buffer in bytes.

◆ OnHeaderReceived()

virtual void wxWebRequestDebugLogger::OnHeaderReceived ( const wxString & name,
const wxString & value )
pure virtual

Called for each header received from the server.

Parameters
nameName of the header
valueString value of the header

◆ OnHeaderSent()

virtual void wxWebRequestDebugLogger::OnHeaderSent ( const wxString & name,
const wxString & value )
pure virtual

Called for each header sent to the server.

This is currently only called when libcurl-based backend is used.

Parameters
nameName of the header
valueString value of the header

◆ OnInfo()

virtual void wxWebRequestDebugLogger::OnInfo ( const wxString & info)
pure virtual

Called to notify about an informational message.

For example, the libcurl-based backend provides details about the protocol used (including TLS version when applicable) and the connection state using this function.

Parameters
infoA single line informational message.

◆ OnRequestSent()

virtual void wxWebRequestDebugLogger::OnRequestSent ( const wxString & line)
pure virtual

Called with the request line sent to the server.

A typical example of such a line would be GET /index.html HTTP/1.1.

◆ OnResponseReceived()

virtual void wxWebRequestDebugLogger::OnResponseReceived ( const wxString & line)
pure virtual

Called with the status line received from the server.

A typical example of such a line would be HTTP/1.1 200 OK.