HTTPLogger

public class HTTPLogger

The logger for logging HTTP request/response.

  • Create a new HTTPLogger.

    Declaration

    Swift

    public init(debugging: Bool? = nil)

    Parameters

    debugging

    optional Enable debugging for HTTP request/response. Default false.

  • Log the HTTP request.

    Declaration

    Swift

    public func log(_ request: URLRequest?)

    Parameters

    request

    to log

  • Log the HTTP response.

    Declaration

    Swift

    public func log(_ response: URLResponse?, _ data: Data?)

    Parameters

    response

    to log

    data

    response data