Constructors
HTTP()
Methods
addAttachmentData(Integer)
Adds the binary data in the Service attachment specified to the body of the request.Must be used together with POST, PUT or PATCH.Many REST endpoints expect the content to be uploaded as binary data when adding files. You can use this method for doing that. automatically set the Content-Type header based on the content type recorded in the database for the attachment. If you want to override the Content-Type, be sure to set a Content-Type header after doing the addAttachmentData call.
addBinaryData(Byte[])
Adds the binary data to the body of the request.Must be used together with POST, PUT or PATCH.Many REST endpoints expect the content to be uploaded as binary data when adding files. You can use this method for doing that. Normally, you also want to add a Content-Type header, indicating what kind of files this is.
addDocumentData(Integer)
Add the binary data in the document specified to the body of the request.Must be used together with POST, PUT or PATCH.Many REST endpoints expect the content to be uploaded as binary data when adding files. You can use this method for doing that. automatically set the Content-Type header based on the extension of the document being added. If you want to override the Content-Type, be sure to set a Content-Type header after doing the addDocumentData call.
addHeader(String,String)
Adds a new header. The new header will be placed after other existing headers.delete(String)
Supports both HTTP and HTTPS.deleteAsStream(String)
Supports both HTTP and HTTPS.get(String)
Supports both HTTP and HTTPS.getAsStream(String)
Supports both HTTP and HTTPS.getDebug()
Retrieves debug output.Turn on debug mode by calling setDebugMode(true) before you use getDebug().
getErrorMessage()
Returns the last error message.getResponseHeader(String)
Gets a named HTTP header from the response of the HTTP request.Case insensitive.
getResponseHeaders()
Gets a map of all the headers from the HTTP response headers after making a HTTP call.The key is in lower case regardless of what was returned by the response. The value will keep the case.
getValue(String)
General function which returns various values from the instance.statusCode: Will return the status code from the HTTP request (such as 404, 200). Supported from v8.0sr3.