question

Stain avatar image
0 Likes"
Stain asked Ben Wilson commented

Script does not make gcloud call!!!!

Hello everyone!

I would like to find out if my code has something written wrong. It should make a call to gcloud using the http.request method, but when I see the function's log, there is no sign of it.

Maybe I forgot some params? Let me know, thanks in advance!


/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int rownumber = param(2); //row number of the schedule/sequence table


/*
string sourceFile = modeldir() + "Data.csv";


importtable(destinationTable, sourceFile, 0);


//string token = destinationTable[0][1];
print(destinationTable.cell(1,1));
*/
Table destinationTable = Table("MyGlobalTable");
string token = "123";


Http.Request request;
request.host = "host";
request.method = Http.Method.Get;
//request.data = "query=select * from Product";
request.useSSL = 1;
request.headers = "Content-Type: application/json\r\n ";
//request.method = Http.Method.Post;
Http.Response response = request.sendAndWait();
//debug();
//Table destinationTable = Table("MyGlobalTable");
destinationTable [1][1] = response.value;
print(response.data);
print(response.value);
print(request.headers);
FlexSim 24.1.1
using codecloudhttp request
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Stain, does the code above represent your actual code, or is it obfuscated?

For instance, you are setting request.host="host", but it actually needs to be set to the web address of the endpoint you are trying to communicate with, like "https://docs.google.com".

Also, it is highly likely that connecting to a cloud service will require some form of authentication that may be difficult (but probably not impossible) to achieve using raw HTTP requests and responses. Have you taken that into account?

0 Likes 0 ·

0 Answers