<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>GitHub Repos</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-3.2.1.js"></script> </head> <body> Username: <input type="text" id="username"/><br><br> Reponame: <input type="text" id="reponame"/><br><br> <button onclick="loadRepos()">Load Repos</button> <div id="repos"> </div> <script> function loadRepos() { var reponame = document.getElementById("reponame").value; var url="https://api.github.com/repos/sunandarath/"+reponame; alert(url); $.ajax({ url, type: 'DELETE', beforeSend: function(xhr) { xhr.setRequestHeader("Authorization", "token f2d8f731ee993982309d593841787b11541ce7e1"); } }).done(function(response) { alert("Repository "+reponame+" is deleted"); }); } </script> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more