am using ajax request for calling jersey restful url.
function deRegisterPersonOrganization() {
var dynamicJson = $('#jsonRequest').val();
alert("Text Area JSON : " +dynamicJson);
var jsonObj = {
"solutionProviderKey" : "e3fad159-ac18-462d-a20e-17763af3689b"
};
$.ajax({
type: 'POST',
contentType: 'application/json',
url: rootURL + '/e3fad159-ac18-462d-a20e-17763af3689b/deregister',
dataType: "json",
data: JSON.stringify(dynamicJson),
success: function(data, textStatus, jqXHR){
alert('Deregister successfull');
},
error: function(jqXHR, textStatus, errorThrown){
alert('Deregister error: ' + textStatus);
}
});
}
The problem is i need to give the JSON request where i will give it through the text area. in the above code if i use variable jsonObj in the place of dynamicJson the request is successful. but if i use dynamicJson where in the textarea i give
{
"solutionProviderKey" : "e3fad159-ac18-462d-a20e-17763af3689b"
}
as request, unable to process request.
Please help me as soon as possible.