mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
added basic templates for rendering
This commit is contained in:
@ -6,6 +6,28 @@ import 'package:apidash/models/models.dart' show RequestModel;
|
|||||||
import 'package:apidash/consts.dart';
|
import 'package:apidash/consts.dart';
|
||||||
|
|
||||||
class PHPcURLCodeGen {
|
class PHPcURLCodeGen {
|
||||||
|
//starting template
|
||||||
|
final String kTemplateStart = """
|
||||||
|
<?php
|
||||||
|
|
||||||
|
""";
|
||||||
|
//initialising the request
|
||||||
|
String kTemplateRequestInit = """
|
||||||
|
|
||||||
|
\$request = curl_init(\$uri);
|
||||||
|
|
||||||
|
""";
|
||||||
|
|
||||||
|
|
||||||
|
//ending template
|
||||||
|
final String kStringRequestEnd = """
|
||||||
|
\$response = curl_exec(\$request);
|
||||||
|
curl_close(\$request);
|
||||||
|
var_dump(\$response);
|
||||||
|
|
||||||
|
""";
|
||||||
|
|
||||||
|
|
||||||
//function for http verb to curl mapping
|
//function for http verb to curl mapping
|
||||||
String httpMethod(String methodName) {
|
String httpMethod(String methodName) {
|
||||||
switch (methodName) {
|
switch (methodName) {
|
||||||
|
Reference in New Issue
Block a user