HttpRequestEventBuilder class

Builder for HTTP request events.

Example:

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';

final builder = HttpRequestEventBuilder(url: 'http://example.com', method: 'GET');
Dynatrace().sendHttpRequestEvent(builder);

For more information, see Dynatrace documentation.

Constructors

HttpRequestEventBuilder({required String url, required String method})

Properties

hashCode int
The hash code for this object.
no setterinherited
method String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
url String
final

Methods

addEventProperty(String key, dynamic value) → void
Adds a custom event property to the event. key must be prefixed with 'event_properties.'. key must contain only alphabetic character, numbers, underscores and dots. Each dot must be followed by an alphabetic character. Each underscore must followed by an alphabetic character or number. value can only contain primitive values.
build() Map<String, dynamic>
Builds and returns the event as a map, validating the URL and method.
bytesReceived(int bytesReceived) → void
Adds bytes received to the event. Only positive numbers are valid.
bytesSent(int bytesSent) → void
Adds bytes sent to the event. Only positive numbers are valid.
duration(int duration) → void
Adds the duration to the event. Only positive numbers are valid.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reasonPhrase(String reasonPhrase) → void
Adds the reasonPhrase to the event. At maximum 5000 characters afterwards will be trimmed.
statusCode(int statusCode) → void
Adds the status code to the event and sets flags for failed requests. Only positive numbers are valid.
throwable(Object throwable) → void
Adds a throwable to the event, setting exception-related properties.
toString() String
A string representation of this object.
inherited
traceparentHeader(String traceparentHeader) → void
Adds a W3C traceparent header (e.g. '00-<traceid>-<spanid>-01'). If valid, sets trace.id & span.id on the event and marks it as API reported. Invalid header is ignored.

Operators

operator ==(Object other) bool
The equality operator.
inherited