send400 method

Future<void> send400(
  1. Socket socket
)

Sends a 400 Bad Request HTTP response to the client.

Implementation

Future<void> send400(Socket socket) async {
  logD('HTTP/1.1 400 Bad Request');
  final String headers = <String>[
    'HTTP/1.1 400 Bad Request',
    'Content-Type: text/plain',
    'Bad Request'
  ].join(httpTerminal);
  await socket.append(headers);
}