I am trying to connect to google healthcare cloud with an API key. They say I should make a Curl request like this:
curl -X POST
-H “Authorization: Bearer $(gcloud auth print-access-token)”
-H “X-goog-api-key: API_KEY”
-H “Content-Type: application/json; charset=utf-8”
-d @request.json
“https://translation.googleapis.com/language/translate/v2”
var oSock as new URLConnection
oSock.RequestHeader("Authorization") = "Bearer {Your gcloud auth access-token}"
oSock.RequestHeader("X-goog-api-key") = "API_KEY"
oSock.RequestHeader("Content-Type") = "application/json; charset=utf-8"
// @request.json means to use the file request.json
// I'm going to assume you know how to read a file in Xojo
// If you are building a JSONItem in Xojo code, you do NOT have to write it to a file
oSock.SetRequestContent("The request.json file contents")
oSock.Send("POST", "https://translation.googleapis.com/language/translate/v2")