Currently, I am making an AJAX request with the specified data. The data being sent is an object and my intention is to send the object itself without converting it to a JSON string. However, when viewing the request in the browser, the payload is shown as [object object], despite me sending a proper JavaScript object.
let emailIdForAPICall = { "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96f7f4f5d6f1fbf7fffab8f5f9fb">[email protected]</a>"};
$.ajax({
type: 'POST',
url: gigyaServlet,
data: {
'profile': emailIdForAPICall,
}
})
Upon triggering the aforementioned API call, the payload appears as depicted below - https://i.sstatic.net/UGo2p.png
I attempted using JSON.parse(JSON.stringify(emailIdForAPICall)) but unfortunately, it did not resolve the issue.
It's concerning that a similar request works correctly on a different site.