* Compute the headers required for an API request. * @private * @param {boolean} raw - if the request should be treated as JSON or as a raw request * @param {string} AcceptHeader - the accept header for the request * @return {Object} - the headers to use in the request
(raw, AcceptHeader)
| 89 | * @return {Object} - the headers to use in the request |
| 90 | */ |
| 91 | __getRequestHeaders(raw, AcceptHeader) { |
| 92 | let headers = { |
| 93 | 'Content-Type': 'application/json;charset=UTF-8', |
| 94 | 'Accept': 'application/vnd.github.' + (AcceptHeader || this.__AcceptHeader), |
| 95 | }; |
| 96 | |
| 97 | if (raw) { |
| 98 | headers.Accept += '.raw'; |
| 99 | } |
| 100 | headers.Accept += '+json'; |
| 101 | |
| 102 | if (this.__authorizationHeader) { |
| 103 | headers.Authorization = this.__authorizationHeader; |
| 104 | } |
| 105 | |
| 106 | return headers; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Sets the default options for API requests |