Kong / apiembed

Embeddable API code snippets for your website, blog or API documentation
https://apiembed.com
MIT License
409 stars 52 forks source link

Enhancing the PHP code templates #18

Open jeremycohensolal opened 9 years ago

jeremycohensolal commented 9 years ago

Hello,

very nice tool!

My suggestion:

In case of

...
"postData": {
    "mimeType": "application/x-www-form-urlencoded",
    "params" : [           
        {
            "name": "params[IDENTIFIER]",
            "value": "DUMMY_ACCOUNT"
        },
        {
            "name": "params[OPERATIONTYPE]",
            "value": "create"
        },
}
...

it would be nice that in the php code to have something like

...
CURLOPT_POSTFIELDS => http_build_query([
    'params[IDENTIFIER]' => 'DUMMY_ACCOUNT',
    'params[OPERATIONTYPE]' => 'create',
])
...

instead of

...
CURLOPT_POSTFIELDS => "params%5BIDENTIFIER%5D=DUMMY_ACCOUNT&params%5BOPERATIONTYPE%5D=create"
...
ahmadnassri commented 9 years ago

makes sense .. did you want to take a stab at making this change, and claim all the fame and glory? :)