methodFromString function

Method methodFromString(
  1. String method
)

Implementation

Method methodFromString(String method) {
  switch (method) {
    case "HEAD":
      return Method.HEAD;
    case "GET":
      return Method.GET;
    case "POST":
      return Method.POST;
    case "PUT":
      return Method.PUT;
    case "PATCH":
      return Method.PATCH;
    case "DELETE":
      return Method.DELETE;
  }
  throw ArgumentError.value(method, "method", "Must be a valid HTTP Method.");
}