MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Invalid JSON When Callback Specified
Current time: 10-23-2020, 07:51 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid JSON When Callback Specified
12-31-2011, 03:16 PM
Post: #1
Invalid JSON When Callback Specified
Hi,

In October I wrote a script to retrieve results from runtest.php. I specified the format JSON and told it to use a callback URL, and it worked fine. I just tried it and no longer works, though I'm not sure when/where the change occurred.

Rather than returning an object in JSON, runtest.php now returns the object in JSON but as if passed into a function: callback(object).

This form of URL:
Code:
http://www.webpagetest.org/runtest.php?private=1&f=json&callback=http://example.com/__callback&location=Dulles_IE8.DSL&k=***&url=google.com

Returns this form of response:
Code:
http://example.com/__callback({"statusCode":200,"statusText":"Ok","data":{"testId":"***","ownerKey":"***","jsonUrl":"http:\/\/www.webpagetest.org\/results.php?test=***&f=json","xmlUrl":"http:\/\/www.webpagetest.org\/xmlResult\/***\/","userUrl":"http:\/\/www.webpagetest.org\/result\/***\/","summaryCSV":"http:\/\/www.webpagetest.org\/result\/***\/page_data.csv","detailCSV":"http:\/\/www.webpagetest.org\/result\/***\/requests.csv"}});

It used to return just the object:
Code:
{"statusCode":200,"statusText":"Ok","data":{"testId":"***","ownerKey":"***","jsonUrl":"http:\/\/www.webpagetest.org\/results.php?test=***&f=json","xmlUrl":"http:\/\/www.webpagetest.org\/xmlResult\/***\/","userUrl":"http:\/\/www.webpagetest.org\/result\/***\/","summaryCSV":"http:\/\/www.webpagetest.org\/result\/***\/page_data.csv","detailCSV":"http:\/\/www.webpagetest.org\/result\/***\/requests.csv"}};

Is this new behavior expected? Thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Invalid JSON When Callback Specified - javert03 - 12-31-2011 03:16 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)