I'm working on an app that gets an XML resource form the web. Like
this.
val url = new URL("
http://server.com");
val data = scala.io.Source.fromURL(url).mkString
It works on some servers I use but on one I get an HTTP 406 error.
I believe it is because the particular server labels the content as
MIME application/xml while the servers that do work label it as MIME
text/xml.
In JAVA you can set the accept type on a "Connection" like this.
connection.setRequestProperty("Accept", "text/html+xml,application/
xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
But in the Scala version I feed the method the URL and don't have a
connection to "set".
How can I specify that I will accept MIME text/xml ?