httpMethodFromString function

HttpMethod httpMethodFromString(
  1. String input
)

Parses an HttpMethod from an input String in UPPER CASE

Implementation

HttpMethod httpMethodFromString(String input) {
  switch (input) {
    case 'GET':
      return HttpMethod.get;
    case 'POST':
      return HttpMethod.post;
    case 'PUT':
      return HttpMethod.put;
    case 'PATCH':
      return HttpMethod.patch;
    case 'DELETE':
      return HttpMethod.delete;
    case 'OTHER':
    default:
      return HttpMethod.other;
  }
}