delQmessage method

Future<void> delQmessage({
  1. required String qName,
  2. required String messageId,
  3. required String popReceipt,
})

The Delete Message operation deletes the specified message from the queue.

'qName': Name of the queue is mandatory.

'messageId': Required. A valid messageId value returned from an earlier call to the Get Messages or Update Message operation.

'popReceipt': Required. A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation.

Implementation

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