Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcff32ef

Browse files
committed
feat(profiler): add cURL copy/paste to request tab
1 parenta4a0463 commitcff32ef

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CHANGELOG
77
* Add support for the`QUERY` HTTP method in the profiler
88
* Add support for Server-Sent Events /`EventSource` requests in the debug toolbar
99
* Add support for displaying the application runner class
10+
* Add cURL copy paste button in the Request/Response tab
1011

1112
7.3
1213
---

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,26 @@
232232
<p>No content</p>
233233
</div>
234234
{%endif %}
235+
236+
<h3>Retry command</h3>
237+
{%setcurlCommand='curl -X'~collector.method~''~profile.url %}
238+
{%forname,valueincollector.requestheaders %}
239+
{%setcurlCommand=curlCommand~ (' -H "%s: %s"'|format(name,value)) %}
240+
{%endfor %}
241+
{%ifcollector.content!='' %}
242+
{%setcurlCommand=curlCommand~" --data '"~ (collector.isJsonRequest?collector.content|json_encode:collector.content)~"'" %}
243+
{%endif %}
244+
<divclass="sf-tabs">
245+
<divclass="tab">
246+
<h3class="tab-title">cURL</h3>
247+
<divclass="tab-content">
248+
<divclass="card">
249+
<buttonclass="btn btn-sm hidden"title="Copy as cURL"data-clipboard-text="{{curlCommand }}">Copy as cURL</button>
250+
<preclass="break-long-words">{{curlCommand }}</pre>
251+
</div>
252+
</div>
253+
</div>
254+
</div>
235255
</div>
236256
</div>
237257

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp