Sending XML Data and Credentials using $.ajax
Hello there
I am successfully using the $.ajax(0 function to get data from a server in what I understand is a relatively secure way:
$.ajax({
type:
"POST"
,
url: "
...
"
,
cache:
false
,
data: { username: "...", password: "..." },
xhrFields: {
withCredentials:
true
}, ...
This works fine, and is in fact what I understand to be a more secure replacement of the original code, which used "GET", and which appended the user name and password to the end of the URL (I used to be able to see the user name and password in fiddler, whereas now I do not).
My issue is with making the following code, which sends data to a server, more secure:
$.ajax({
type:
"POST"
,
url:
"...
&UserName=...
&Password=..."
,
data: xmlResult,
contentType:
"text/xml",
...
I have not been able to use the same trick of moving the user name and password into the data element, as we are already using this for the XML that we are uploading. I have tried several approaches to no avail, including using separate "username" and "password" elements, and attempting to concatenate the user name and password to the xml data in various ways.
Is there any way I can remove the user name and password from the URL in this scenario?
Any help greatly appreciated
Geoff Olding