mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 05:32:26 +08:00
added http verb to php curlopt conversion function
This commit is contained in:
@ -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 "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user