I read about this here and here, but still I couldn't figure out how to do it in jQuery ajax
. I tried the code from one of the answers of the questions I linked, but it discarded the user agent override:
$.ajax({
url: "http://blablabla.com/",
dataType:'html',
beforeSend: function (req) {
req.setRequestHeader('User-Agent', 'https://graphicdesign.stackexchange.com/users/69916/vikas');
},
error: function() { alert("No data found");},
success: parseResult
});
My current User-agent string that is being sent is this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.40 Safari/537.36 Edg/92.0.902.9
And I want to add my other SE profile URL too, in this which is https://graphicdesign.stackexchange.com/users/69916/vikas
I want to do this because it has been suggested here in case you're involved in chatbots.
A simple example about how to put additional information, i.e., my profile URL in existing User-agent and send it using ajax to any api, would help.