@@ -31,8 +31,13 @@ $log = $viewModel->getLog();
3131<p><b>request_method:</b></p>
3232<p><?= $ log ->getData ('request_method ' ) ?> </p>
3333<br/>
34- <p><b>request_body:</b> <button class="js_beauty_json">Prettify JSON</button></p>
35- <p><?= $ log ->getData ('request_body ' ) ?> </p>
34+ <?php if (preg_match ('/^<\?xml/ ' , $ log ->getData ('request_body ' ))): ?>
35+ <p><b>request_body:</b></p>
36+ <pre style="border:1px solid #CCC;height:300px;overflow-y:auto;padding:10px;font-size:12px"><?= htmlentities ($ log ->getData ('request_body ' )) ?> </pre>
37+ <?php else : ?>
38+ <p><b>request_body:</b> <button class="js_beauty_json">Prettify JSON</button></p>
39+ <p><?= $ log ->getData ('request_body ' ) ?> </p>
40+ <?php endif ; ?>
3641<br/>
3742<p><b>request_headers:</b></p>
3843<p><?= $ log ->getData ('request_headers ' ) ?> </p>
@@ -41,8 +46,13 @@ $log = $viewModel->getLog();
4146<p><b>response_code:</b></p>
4247<p><?= $ log ->getData ('response_code ' ) ?> </p>
4348<br/>
44- <p><b>response_body:</b> <button class="js_beauty_json">Prettify JSON</button></p>
45- <p><?= $ log ->getData ('response_body ' ) ?> </p>
49+ <?php if (preg_match ('/^<\?xml/ ' , $ log ->getData ('response_body ' ))): ?>
50+ <p><b>response_body:</b></p>
51+ <pre style="border:1px solid #CCC;height:300px;overflow-y:auto;padding:10px;font-size:12px"><?= $ log ->getData ('response_body ' ) ?> </pre>
52+ <?php else : ?>
53+ <p><b>response_body:</b> <button class="js_beauty_json">Prettify JSON</button></p>
54+ <p><?= $ log ->getData ('response_body ' ) ?> </p>
55+ <?php endif ; ?>
4656<br/>
4757<p><b>request_datetime:</b></p>
4858<p><?= $ log ->getData ('request_datetime ' ) ?> </p>
0 commit comments