I have a query that elicits a plain text response. In Postman I have configured the query’s headers to include Content-Type=text/plain, but when I run the query in Collection Runner I always get:
JSONError: Unexpected token ‘M’ at 1:1
MTR=20&PGTR=20P&authCode=240966&amount=1000&result=0&digest=ec0406d173c7301a632^
Collection Runner then stops instead of proceeding to run the next request in my collection.
When I force Collection Runner to run the next request, it fails to pick up a variable that was set by the previous query’s test script, even though I have “Keep variable values” checked. I am open to the possibility that these latter issues might be as a result of the first, although I have some doubt - the test script has clearly run because I get shown the results of its tests in Collection Runner, so the variable should have persisted.
The variable is set by this code:
var respData = JSON.parse(responseBody);
pm.variables.set(“PGTR”, respData.PGTR);
The following request accesses the variable using the standard {{PGTR}} syntax. I know it isn’t being picked up because the console shows that the {{PGTR}} (albeit URL-encoded) has been included in the query rather than substituted.
Anyone any ideas?