delete method Null safety

Object delete(
  1. String name
)

Deletes a header from a Headers object. myHeaders.delete(name); Creating an empty Headers object is simple:

var myHeaders = new Headers(); // Currently empty

You could add a header to this using Headers.append:

myHeaders.append('Content-Type', 'image/jpeg'); myHeaders.get('Content-Type'); // Returns 'image/jpeg' You can then delete it again:

myHeaders.delete('Content-Type'); myHeaders.get('Content-Type'); // Returns null, as it has been deleted

Implementation

external Object delete(String name);