Savvoy

ajax jq

Dec 28th, 2020
1,858
146 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $.ajax({
  2.   type: 'POST',
  3.   url: "http://localhost:8080/project/server/rest/subjects",
  4.   data: JSON.stringify({
  5.     "subject:title":"Test Name",
  6.     "subject:description":"Creating test subject to check POST method API",
  7.     "sub:tags": ["facebook:work", "facebook:likes"],
  8.     "sampleSize" : 10,
  9.     "values": ["science", "machine-learning"]
  10.   }),
  11.   error: function(e) {
  12.     console.log(e);
  13.   },
  14.   dataType: "json",
  15.   contentType: "application/json"
  16. });
RAW Paste Data