Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
// Make an example request, simulating CORS.
$.ajax({
  url: "http://localhost:5000/api/v1/users/create",
  type: "POST",
  crossDomain: true,
  dataType: "json",
  success: function (response) {
    console.log("Just made a cross origin POST!");
    console.log(response);
  },
  error: function(res){
    console.log(res);
  }
}).always(function(){
  $.ajax({
    url: "http://localhost:5000/api/v1/users/",
    type: "GET",
    crossDomain: true,
    dataType: "json",
    success: function (response) {
      console.log("Just made a cross origin GET!");
      console.log(response);
    },
    error: function(res){
      console.log(res);
    }
  });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x