here is my code snippet i am using
function makeRequest() as Void {
System.println("makeRequest");
var url = "">https://somthing";
var graphqlQuery = "query getLatestDeviceData {getDeviceData(vin: \"VIN_123456789\") {response {unitid}}}";
var headers = {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
"Authorization" => "Bearer APi_KEY"
};
var options = {
:method => Communications.HTTP_REQUEST_METHOD_POST,
:headers => headers,
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
var body = {
"query" => graphqlQuery
};
Communications.makeWebRequest(url, body, options, method(:onReceive));
}