title: Capture server JSON response in end-to-end test
body: <p>I'm writing an end-to-end test that simulates user authentication with <a href="http://angular.github.io/protractor/#/" rel="nofollow noreferrer">Protractor</a>. A user feels in her credentials and clicks a Submit button. As a result, the server returns an access token in a JSON response that can be used for other REST API calls. I'd like to save this token to a file.</p>
  
  <p>There's a similar question on capturing a response of a GET request <a href="https://stackoverflow.com/questions/25137881/how-to-use-protractor-to-get-the-response-status-code-and-response-text">here</a>, but I'm not sure it's a good idea to send another request after I click the button.</p>
  
  <p>How can I capture the response after a button click?</p>