clearQmessages method

Future<void> clearQmessages(
  1. String qName
)

The Clear Messages operation deletes all messages from the specified queue.

'qName': Name of the queue is mandatory.

Implementation

Future<void> clearQmessages(String qName) async {
  String path =
      'https://${config[accountName]}.queue.core.windows.net/$qName/messages';
  var request = http.Request('DELETE', Uri.parse(path));
  _sign(request);
  var res = await request.send();
  var message = await res.stream.bytesToString();
  if (res.statusCode >= 200 && res.statusCode < 300) {
    return;
  }
  throw AzureStorageException(message, res.statusCode, res.headers);
}