sendCustom method
void
sendCustom({
- required String content,
- required ContentType contentType,
- Map<
String, String> ? headers,
Sends a custom response with full control.
Implementation
void sendCustom({
required String content,
required ContentType contentType,
Map<String, String>? headers,
}) {
if (_sent) return;
_headers.setContentType(contentType);
headers?.forEach((key, value) {
_headers.setHeader(key, value);
});
_response.add(_safeUtf8Encode(content));
_closeResponse();
}