Home » HTTP
The HTTP Module allows you to create HTTP and HTTPS requests as HTTPRequest objects, send them, and use their responses as HTTPResult objects.
The HTTP module exposes methods for creating HTTPRequest objects.
Creates an HTTPRequest from the provided HTTP request method and resource URI.
var request = HTTP.create('GET', 'https://daas.caristix.com/fhir_r4/Patient');
Creates an HTTPRequest from the provided HTTP request method, NetworkConnection object and resource URL path. Request host, client certificate and timeout are obtained from the NetworkConnection.
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.
request.setBody('MSH|^~\&|');
//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.
request.setTimeout(5);
//The request's timeout should be equal to 5 seconds.
Sets the request’s Client Certificate using the provided serial number.
request.setCertificate('7571563212351');
Adds an HTTP header to the request.
request.setHeader('accept', 'application/json');
//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;
NORTH AMERICA: +1 (877)-872-0027
WORLD: 1-418-872-4000
EMAIL: info@caristix.com
ASIA-PACIFIC
DENIS CANTIN
T: +61418441388
denis.cantin@caristix.com
NORTH AMERICA & EUROPE
JEAN-LUC MORIN
T: 418 872-4000
jeanluc.morin@caristix.com
HL7® / FHIR® are a registered trademarks of Health Level Seven International. The use of this trademark does not constitute an endorsement by HL7.