The HTTP module exposes methods for creating HTTPRequest objects.
var request = HTTP.create('GET', 'https://daas.caristix.com/fhir_r4/Patient');
var connection = NetworkConnections.getConnection('DaaS Caristix FHIR R4 Server');
var requestFromConnection = HTTP.createFromNetworkConnection('GET', connection, '/Patient');
This object exposes properties and methods to edit and send an HTTP request.
The HTTP method used by the request, as defined when creating the request.
var method = request.method;
// The value should be equal to "GET".
The fully-qualified URI of the request, as defined when creating the request.
var uri = request.uri;
//The value should be equal to "https://daas.caristix.com/fhir_r4/Patient"
Sends the request and returns the result.
var result = request.send();
Sets the request’s body to the provided string.
//The request's body should be equal to "MSH|^~\&|"
Sets the request’s timeout in seconds to the provided amount. The default value is 30 seconds.
//The request's timeout should be equal to 5 seconds.
Sets the request’s Client Certificate using the provided serial number.
Adds an HTTP header to the request.
//The request should contain the "Accept" header with value "application/json"
This object exposes properties to read an HTTP response’s body and status code.
The response’s body.
var body = result.body;
The response’s HTTP status code.
var status = result.statusCode;
var succeeded = status == 200;