-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order of Form Parameters is not preserved (application/x-www-form-urlencoded) #447
Comments
So the call is from https://github.com/playframework/play-ws/blob/master/play-ahc-ws-standalone/src/main/java/play/libs/ws/ahc/StandaloneAhcWSRequest.java#L450 Looking at https://github.com/playframework/play-ws/blob/master/play-ahc-ws-standalone/src/main/scala/play/api/libs/ws/ahc/FormUrlEncodedParser.scala#L47 it certainly seems like Can you put together a test case? |
Or is it that the If you call def parseAsJava(data: String, encoding: String): java.util.Map[String, java.util.List[String]] = {
import scala.collection.JavaConverters._
val insertHashMap = new util.LinkedHashMap[String, java.util.List[String]]()
parse(data, encoding).foreach {
case (key, values) =>
insertHashMap.put(key, values.asJava)
}
insertHashMap
}
def parseAsJavaArrayValues(data: String, encoding: String): java.util.Map[String, Array[String]] = {
val insertHashMap = new util.LinkedHashMap[String, Array[String]]()
parse(data, encoding).foreach {
case (key, values) =>
insertHashMap.put(key, values.toArray)
}
insertHashMap
} does that change things for you? |
Hi, seems I have a different implementation: def parseAsJava(data: String, encoding: String): java.util.Map[String, java.util.List[String]] = { there is no "foreach", there is a "map" - which will change the order. I´ll check my revision. Thanks! |
Did you change it to "foreach" in your example? |
@Marc2017 yeah, the example above is using a |
Play WS Version (2.7.2 / etc)
JAVA
In StandaloneAhcWSRequest the order of Form-Parameters is not preserved:
"FormUrlEncodedParser.parseAsJava" does not preserver the order, and "stringListMap" is unordered.
The text was updated successfully, but these errors were encountered: