Skip to content

Files

Latest commit

d86dfea · May 28, 2019

History

History
31 lines (24 loc) · 802 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 802 Bytes

List of Registered HTTP Methods

This package provides a list of all registered HTTP methods, as well as whether a method is considers safe, that is, specified in HTTP 1.1.

Disclaimer: This is not an officially supported Google product.

Example

import 'package:http_methods/http_methods.dart';

void main() {
  assert(isHttpMethod('get'));
  assert(isHttpMethod('GET'));
  assert(isHttpMethod('PUT'));
  assert(!isHttpMethod('not-a-method'));

  print('all http methods:');
  for (String method in httpMethods) {
    print(method);
  }
}

See Also