diff --git a/lib/codegen/php/curl.dart b/lib/codegen/php/curl.dart index 6b5239fb..cd62e405 100644 --- a/lib/codegen/php/curl.dart +++ b/lib/codegen/php/curl.dart @@ -6,4 +6,23 @@ import 'package:apidash/models/models.dart' show RequestModel; import 'package:apidash/consts.dart'; class PHPcURLCodeGen { + //function for http verb to curl mapping + String httpMethod(String methodName) { + switch (methodName) { + case "POST": + return "CURLOPT_POST"; + case "GET": + return "CURLOPT_HTTPGET"; + case "PUT": + return "CURLOPT_PUT"; + case "DELETE": + return "CURLOPT_CUSTOMREQUEST"; + case "PATCH": + return "CURLOPT_CUSTOMREQUEST"; + case "HEAD": + return "CURLOPT_NOBODY"; + default: + return ""; + } + } }