YouTrack InCloud 2017.2 Help

Response

Object containing HTTP response properties.

// Get a content of a PasteBin paste, assuming that we have somehow received its key (`pasteBinKey`). var connection = new http.Connection('http://pastebin.com/raw/'); connection.addHeader({name: Content-Type, value: text/plain}); var response = connection.getSync(pasteBinKey, ''); if (response && response.code === 200) { var text = ''; response.headers.forEach(function(header) { text += header.name + ': ' + header.value + '\n'; }); text += '\n' + response.response; issue.addComment(text); }

Properties

NameTypeDescriptionRead-only
code number response code. Can be null in case an exception occurs during processing.
exception Object an exception that occurred during processing.
headers Array.<{name: String, value: String}> response headers. Can be null in case an exception occurs during processing.
isSuccess boolean `true` in case response status is in interval from 200 (inclusive) to 400 (exclusive).
response string response body. Can be null in case an exception occurs during processing.
responseAsStream Object byte stream representation of response body. Can be null in case an exception occurs during processing.
Last modified: 9 August 2017