docs/console.js
function displayResponse(response){
  
  // Gather and display HTTP response data
  var lines = [
    response.statusCode + ' ' + response.statusText,
    headersToString(response.headers)
  ];
  if(response.data){
    lines.push('');
    lines.push(prettyPrint(response.data));
  }
  output(lines.join('\n'));
  
  // Attach listeners to links so that clicking a link will auto-populate
  // the url field
  Array.from($output.querySelectorAll('.link')).forEach(function(link){
    link.addEventListener('click', function(){
      // Remove leading and trailing "
      $url.value = link.innerHTML.slice(1,-1);
      window.scrollTo(0, 0);
    });
  });
}
function displayResponse(response){
  
  // Gather and display HTTP response data
  var lines = [
    response.statusCode + ' ' + response.statusText,
    headersToString(response.headers)
  ];
  if(response.data){
    lines.push('');
    lines.push(prettyPrint(response.data));
  }
  output(lines.join('\n'));
  
  // Attach listeners to links so that clicking a link will auto-populate
  // the url field
  Array.from($output.querySelectorAll('.link')).forEach(function(link){
    link.addEventListener('click', function(){
      // Remove leading and trailing "
      $url.value = link.innerHTML.slice(1,-1);
      window.scrollTo(0, 0);
    });
  });
}
function displayResponse ( response ) { // Gather and display HTTP response data var lines = [ response . statusCode + ' ' + response . statusText , headersToString ( response . headers ) ] ; if ( response . data ) { lines . push ( '' ) ; lines . push ( prettyPrint ( response . data ) ) ; } output ( lines . join ( '\n' ) ) ; // Attach listeners to links so that clicking a link will auto-populate // the url field Array . from ( $output . querySelectorAll ( '.link' ) ) . forEach ( function ( link ) { link . addEventListener ( 'click' , function ( ) { // Remove leading and trailing " $url . value = link . innerHTML . slice ( 1 , - 1 ) ; window . scrollTo ( 0 , 0 ) ; } ) ; } ) ; }
Display an API response

@param {Object} response
Display an API response