I was wondering, how can I read an ETag that is attached to a server response for a client side POST request that has occured through ajax. At the moment I am POSTing like this from the client side and I get the actual body of the response from the server:
$.ajax({
type: "POST",
accepts: "text/plain",
url: "http://localhost:3000/somewhere",
data: JSON.stringify(someObject),
contentType: "application/json; charset=UTF-8",
dataType: "text",
success: function(data) {
window.alert("Received back: '" + data + "'");
},
username: theUsername,
password: thePassword
});
The server responds to the POST request by setting the headers like this:
res.writeHead (200, {"ETag": "\"" + anETag + "\"", "Content-Type": "text/plain"});
Thanks in advance for your time.