JokerResponse.text constructor
JokerResponse.text(})
Creates a successful response with text body
Example:
final response = JokerResponse.text('Hello, World!');
Implementation
factory JokerResponse.text(
String text, {
int statusCode = 200,
Map<String, String> headers = const {},
Duration? delay,
}) {
final textHeaders = {
'content-type': 'text/plain; charset=utf-8',
...headers,
};
return JokerResponse(
statusCode: statusCode,
headers: textHeaders,
body: text,
delay: delay,
);
}