With jQuery ajax methods you have two ways to set headers - those headers will be sent with the request...
1.
$.ajax({
type: 'POST',
url: 'https://auspost.com.au/api/postage/parcel/domestic/weight',
headers: {
"auth-key":"value"
}
});
2.
$.ajax({
type: 'POST',
url: 'https://auspost.com.au/api/postage/parcel/domestic/weight',
beforeSend: function(xhr) {
xhr.setRequestHeader("auth-key", "value");
}
});