addEndpointBreakpoint method

InfospectNetworkBreakpoint addEndpointBreakpoint({
  1. required String endpoint,
  2. String? method,
  3. bool breakOnRequest = true,
  4. bool breakOnResponse = true,
  5. bool enabled = true,
  6. List<InfospectBreakpointCondition> conditions = const <InfospectBreakpointCondition>[],
})

Adds a breakpoint for endpoint, optionally scoped to method.

When method is omitted, every HTTP method for that endpoint is paused.

Implementation

InfospectNetworkBreakpoint addEndpointBreakpoint({
  required String endpoint,
  String? method,
  bool breakOnRequest = true,
  bool breakOnResponse = true,
  bool enabled = true,
  List<InfospectBreakpointCondition> conditions =
      const <InfospectBreakpointCondition>[],
}) {
  final breakpoint = InfospectNetworkBreakpoint(
    id: InfospectBreakpointManager.newId(),
    endpoint: endpoint,
    method: method,
    enabled: enabled,
    breakOnRequest: breakOnRequest,
    breakOnResponse: breakOnResponse,
    conditions: conditions,
  );
  addBreakpoint(breakpoint);
  return breakpoint;
}