SP.WebRequestInfo.headers property (sp.js)

Gets or sets a dictionary containing the name-value pairs for the headers to send in the HTTP request.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var value = SP.WebRequestInfo.get_headers ()
var value = SP.WebRequestInfo.set_headers ()

Return value

Undefined

Remarks

The Content-Type header is ignored and computed based on the size of the body. The following headers are stripped off: Host, TE, Authorization, UserAgent, and TransferEncoding.