sahaya / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

how to register the TEXT Parser #224

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Register the TEXT Parser in the Test Script
RestAssured.registerParser("text/plain", Parser.TEXT);
2.Execute the Test code 
3.Obtain the error message 

java.lang.IllegalStateException: Expected response to be verified as JSON, HTML 
or XML but content-type 'text/plain' is not supported out of the box.

Try registering a custom parser using:
   RestAssured.registerParser("text/plain", <parser type>);

What is the expected output? What do you see instead?
expected output is to view the values of the xml elements.
"BINGO.@context" value =   CURRENTANDNEXTGAME
"BINGO.GAMES.@progressivejackpot" value = 4152.17
instead I keep getting this error message 
java.lang.IllegalStateException: Expected response to be verified as JSON, HTML 
or XML but content-type 'text/plain' is not supported out of the box.

Try registering a custom parser using:
   RestAssured.registerParser("text/plain", <parser type>);

What version of the product are you using? On what operating system?
Rest-Assured 1.7.2  and Operating system is Windows 7 

Please provide any additional information below.

How to resolve this issue.  How to register the TEXT Parser so that this issue 
is resolved . 

java.lang.IllegalStateException: Expected response to be verified as JSON, HTML 
or XML but content-type 'text/plain' is not supported out of the box.

Try registering a custom parser using:
   RestAssured.registerParser("text/plain", <parser type>);

Original issue reported on code.google.com by syed.ari...@gmail.com on 1 Apr 2013 at 2:32

GoogleCodeExporter commented 9 years ago
If you are looking for using Groovy Gath expressions for plain/text responses I 
think you need to use RestAssured.registerParser("text/plain", Parser.XML) 

Original comment by johan.ha...@gmail.com on 2 Apr 2013 at 5:02

GoogleCodeExporter commented 9 years ago
No response from user

Original comment by johan.ha...@gmail.com on 14 Apr 2013 at 1:35