{"action":"created","issue":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/197","labels_url":"https://api.github.com/repos/jayway/rest-assured/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/jayway/rest-assured/issues/197/comments","events_url":"https://api.github.com/repos/jayway/rest-assured/issues/197/events","html_url":"https://github.com/jayway/rest-assured/issues/197","id":96122089,"number":197,"title":"Add JSONP support","user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jayway/rest-assured/labels/enhancement","name":"enhancement","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/rest-assured/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/jayway/rest-assured/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T18:01:52Z","updated_at":"2015-07-20T18:01:53Z","closed_at":null,"body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on March 10, 2011 15:00:54_\n\nE.g. \r\n\r\nexpect().body(\"root.child\", equalTo(\"x\")).when(\"/jsonp?callback=y\");\r\n\r\nBut perhaps it's better/easier to do something like:\r\n\r\nexpect().jsonp(\"callback\", \"y\").body(\"root.child\", equalTo(\"x\")).when().get(\"/jsonp\");\r\n\r\nor:\r\n\r\nexpect().jsonp(\"callback\").body(\"root.child\", equalTo(\"x\")).when().get(\"/jsonp\"); \r\n\r\nwhich should generate a random method-name.\r\n\r\nIt should also be possible to set it as default:\r\n\r\nRestAssured.expectedParser = jsonp(\"callback\", \"y\");\r\nRestAssured.expectedParser = jsonp(\"callback\");\r\nRestAssured.expectedParser = auto(); // Default\r\n\r\nThere should also be a JsonpPath that simply extends JsonPath and removes method call.\n\n_Original issue: http://code.google.com/p/rest-assured/issues/detail?id=42_"},"comment":{"url":"https://api.github.com/repos/jayway/rest-assured/issues/comments/122969146","html_url":"https://github.com/jayway/rest-assured/issues/197#issuecomment-122969146","issue_url":"https://api.github.com/repos/jayway/rest-assured/issues/197","id":122969146,"user":{"login":"johanhaleby","id":187029,"avatar_url":"https://avatars.githubusercontent.com/u/187029?v=3","gravatar_id":"","url":"https://api.github.com/users/johanhaleby","html_url":"https://github.com/johanhaleby","followers_url":"https://api.github.com/users/johanhaleby/followers","following_url":"https://api.github.com/users/johanhaleby/following{/other_user}","gists_url":"https://api.github.com/users/johanhaleby/gists{/gist_id}","starred_url":"https://api.github.com/users/johanhaleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanhaleby/subscriptions","organizations_url":"https://api.github.com/users/johanhaleby/orgs","repos_url":"https://api.github.com/users/johanhaleby/repos","events_url":"https://api.github.com/users/johanhaleby/events{/privacy}","received_events_url":"https://api.github.com/users/johanhaleby/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T18:01:53Z","updated_at":"2015-07-20T18:01:53Z","body":"_From [johan.ha...@gmail.com](https://code.google.com/u/105676376875942041029/) on March 10, 2011 06:03:14_\n\nIf using:\r\n\r\nexpect().body(\"root.child\", equalTo(\"x\")).when(\"/jsonp?callback=y\");\r\n\r\nwe can try to detect whether or not the response is JSONP or plain JSON by e.g. using reg exp."}}