When using the Adobe Lightroom Catalog API to access the catalogs in a Lightroom account, the resulting data is a combination of code and JSON starting with:
while (1) {}\n{\"base\":\"https://lr.adobe.io/v2/\",\"id\":\"7afe....
This is different from the documentation which only specifies the JSON.
Can I safely trim the "while (1) {} at the beginning
Should I modify my request
Should I do other changes to GET response string as well?
Yes, you can safely trim off the
while (1) {}
part.It is simply a security measure to prevent automatic execution of malicious code hidden inside the json structure.
Unfortunately, this can make your code more complicated. Instead of a simple
you must do something like this: