mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Display select to choose http method in sandbox
This commit is contained in:
parent
4beb08e587
commit
e7d3c803bb
@ -366,7 +366,7 @@
|
||||
|
||||
$('.pane.sandbox form').submit(function() {
|
||||
var url = $(this).attr('action'),
|
||||
method = $(this).attr('method'),
|
||||
method = $('[name="header_method"]', this).val(),
|
||||
self = this,
|
||||
params = {},
|
||||
formData = new FormData(),
|
||||
@ -377,8 +377,6 @@
|
||||
|
||||
if (method === 'ANY') {
|
||||
method = 'POST';
|
||||
} else if (method.indexOf('|') !== -1) {
|
||||
method = method.split('|').sort().pop();
|
||||
}
|
||||
|
||||
// set requestFormat
|
||||
|
@ -201,7 +201,7 @@
|
||||
{% if app.request is not null and data.https and app.request.secure != data.https %}
|
||||
Please reload the documentation using the scheme {% if data.https %}HTTPS{% else %}HTTP{% endif %} if you want to use the sandbox.
|
||||
{% else %}
|
||||
<form method="{{ data.method|upper }}" action="{% if data.host is defined %}{{ data.https ? 'https://' : 'http://' }}{{ data.host }}{% endif %}{{ data.uri }}">
|
||||
<form method="" action="{% if data.host is defined %}{{ data.https ? 'https://' : 'http://' }}{{ data.host }}{% endif %}{{ data.uri }}">
|
||||
<fieldset class="parameters">
|
||||
<legend>Input</legend>
|
||||
{% if data.requirements is defined %}
|
||||
@ -247,6 +247,18 @@
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="headers">
|
||||
{% set methods = data.method|upper|split('|') %}
|
||||
{% if methods|length > 1 %}
|
||||
<legend>Method</legend>
|
||||
<select name="header_method">
|
||||
{% for method in methods %}
|
||||
<option value="{{ method }}">{{ method }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
<input type="hidden" name="header_method" value="{{ methods|join }}" />
|
||||
{% endif %}
|
||||
|
||||
<legend>Headers</legend>
|
||||
|
||||
{% if acceptType %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user