Skip to content

Commit cfb867b

Browse files
author
MarvinJWendt
committed
Mini-version of debug.html
1 parent 24db318 commit cfb867b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

debug.min.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><head> <title>API Debugger</title> <style>.center{text-align: center; margin-left: auto; margin-right: auto; margin-top: 100px;}textarea{width: 600px; height: 450px; font-size: 18px;}input{height: 30px; width: 1200px; font-size: 15px;}button{font-size: 20px; margin-top: 10px;}</style></head><body> <div class="center"> <h1>API-Debugger</h1> <div> <input id="url" placeholder="/api"/> <br><br></div><div> <textarea id="body" placeholder="Body"></textarea> <textarea id="response" placeholder="Response"></textarea> </div><div> <button onclick="submit('GET')">GET</button> <button onclick="submit('POST')">POST</button> <button onclick="submit('PUT')">PUT</button> <button onclick="submit('DELETE')">DELETE</button> </div><div> <button onclick="toJSON()">Beauty-JSON</button> </div></div></body></html><script>function submit(method){var http=new XMLHttpRequest(); http.open(method, document.getElementById('url').value, true); http.onreadystatechange=function(){if(http.readyState==4){if(http.status==200 | http.status==201 | http.status==202){document.getElementById('response').value=http.responseText;}else{document.getElementById('response').value="Error: " + http.status;}}}http.send(document.getElementById('body').value);}function toJSON(){document.getElementById('response').value=JSON.stringify(JSON.parse(document.getElementById('response').value), null, '\t');}</script>

0 commit comments

Comments
 (0)