Scala Play reading XML string -


i sending xml(text/xml) content-type , in controller getting string as

`anycontentasxml(<sometag>....</sometag>)` 

which should like

'<?xml version='1.0' encoding='utf-8'?><sometag>....</sometag>` 

so how can convert anycontentasxml xml string?

play has builtin xml body parser, can use like

def someendpoint = action(parse.xml) { request =>   val elementopt = request.body \\ "someelement" headoption } 

notice that, request.body nodeseq , can used xml releated thing.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -