how to set request header in javascript code example Example: js xmlhttprequest add header XMLHttpRequest.setRequestHeader(header, value)