function parseHeader (requestJson) {
  if (!Array.isArray(requestJson.header)) {
    return '';
  }

  return requestJson.header.reduce((headerSnippet, header) => {
    if (!header.disabled) {
      if (sanitize(header.key, true).toLowerCase() === 'user-agent') {
        headerSnippet += `client.UserAgent = "${sanitize(header.value)}";\n`;
      }
      else {
        headerSnippet += `request.AddHeader("${sanitize(header.key, true)}", "${sanitize(header.value)}");\n`;
      }
    }
    return headerSnippet;
  }, '');
}
/**
 * Parses header in Postman-SDK request and returns code snippet of csharp-restsharp for adding headers
 *
 * @param {Object} requestJson - Postman SDK request object
 * @returns {String} code snippet for adding headers in csharp-restsharp
 */
Parses header in Postman-SDK request and returns code snippet of csharp-restsharp for adding headers
@param {Object} requestJson - Postman SDK request object
@returns {String} code snippet for adding headers in csharp-restsharp
Parses header in Postman - SDK request and returns code snippet of csharp - restsharp for adding headers @param { Object } requestJson - Postman SDK request object @returns { String } code snippet for adding headers in csharp - restsharp
function parseHeader (requestJson) {
  if (!Array.isArray(requestJson.header)) {
    return '';
  }
  return requestJson.header.reduce((headerSnippet, header) => {
    if (!header.disabled) {
      if (sanitize(header.key, true).toLowerCase() === 'user-agent') {
        headerSnippet += `client.UserAgent = "${sanitize(header.value)}";\n`;
      }
      else {
        headerSnippet += `request.AddHeader("${sanitize(header.key, true)}", "${sanitize(header.value)}");\n`;
      }
    }
    return headerSnippet;
  }, '');
}
function parseHeader ( requestJson ) { if ( ! Array . isArray ( requestJson . header ) ) { return '' ; } return requestJson . header . reduce ( ( headerSnippet , header ) => { if ( ! header . disabled ) { if ( sanitize ( header . key , true ) . toLowerCase ( ) === 'user-agent' ) { headerSnippet += ` ${ sanitize ( header . value ) } \n ` ; } else { headerSnippet += ` ${ sanitize ( header . key , true ) } ${ sanitize ( header . value ) } \n ` ; } } return headerSnippet ; } , '' ) ; }
Parses header in Postman-SDK request and returns code snippet of csharp-restsharp for adding headers
 @param {Object} requestJson - Postman SDK request object
 @returns {String} code snippet for adding headers in csharp-restsharp
Parses header in Postman - SDK request and returns code snippet of csharp - restsharp for adding headers @param { Object } requestJson - Postman SDK request object @returns { String } code snippet for adding headers in csharp - restsharp