To fix this easily, this is to stop relying on the raw Response.Body string parser in Studio and instead use the built-in GetJSON method from the REST Proxy object. The Body property often remains null or empty if the underlying HTTP handler does not explicitly buffer the stream into a string before the status code check completes. This is a common gotcha when dealing with asynchronous execution in Studio snippets.
You need to ensure you are calling the correct method chain. Instead of JsonParse(Response.Body), you should access the JSON object directly via the proxy’s result. Here is the corrected flow:
// 1. Initialize your proxy
var proxy = GetRESTProxy();
proxy.SetEndpoint("https://api.example.com/data");
proxy.SetMethod("GET");
// 2. Execute the request
var result = proxy.Execute();
// 3. Check status first
if (result.StatusCode == 200) {
// 4. Access JSON directly, do not parse Body manually
var data = result.GetJSON();
// 5. Map to your variable
SetVariable("myData", data);
} else {
SetVariable("error", "Failed with status: " + result.StatusCode);
}
I have seen this exact behavior when extracting data for Snowflake staging tables via Studio. The GetJSON() method handles the deserialization internally and returns a usable object, bypassing the null body issue entirely. If GetJSON() also returns null, verify that your API endpoint is not returning an empty 200 response (e.g., {}) which might be interpreted as null depending on the parser version.
Verify the API actually returns a non-empty JSON payload.
Check if GetJSON() is available in your specific Studio environment version.
Ensure no network proxy is stripping the response body.
Review the Execute return type documentation for your region.