Pass "key" in request headers in a jQuery AJAX POST call

QuestionsCategory: AjaxPass "key" in request headers in a jQuery AJAX POST call
Umar asked 4 years ago

How to Pass “key” in request headers in a jQuery AJAX POST call

 

Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, we will receive an affiliate commission. Regardless, we only recommend products or services we use personally and believe will add value to our readers.

1 Answers
Best Answer
Shehryar Khan Staff answered 4 years ago
$.ajax({
    url: "/testing",
    headers: {"key": "user-key"}
});

 

Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, we will receive an affiliate commission. Regardless, we only recommend products or services we use personally and believe will add value to our readers.