NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Sibuya on May 27, 2016, 07:59:45 AM
-
Hi,
I'm working with a 3rd party JavaScript component that works with promises. So I have to receive an Ajax call with GET/POST with text or Json get data and I have to answer with text or Json too. Could anyone give me directions on how to get Ajax postings/data and how to answer?
Examples:
$.ajax({
method: 'GET',
url: '/SecwinLoginForm?parameter',
success: onSuccess,
error: onError
});
and
$.ajax({
method: 'POST',
url: '/SecwinLoginForm',
data: JSON.stringfy({
data1: parameter1,
data2: parameter2
}),
contentType: 'application/json',
success: onSuccess,
error: onError
});
In WebHandler I try to get in ProcessGet but it does not enter in it.
Thank you.
Marcos
-
Generally speaking I would suggest a NetWebServiceMethod using the "name" of the URL.
That has facilities for parsing incoming Json, and creating Json in response.
The URL is the MethodName.
Cheers
Bruce