Answer the question
In order to leave comments, you need to log in
How to send a get request using play framework ws without doing url encode?
Hello! Now I am engaged in the integration of our project on Play 2.3.8 and gis.
With gis, communication occurs with the help of get requests.
Here is a correct example of a request to get an object:
http://myGisServer.ru/myservice?token=XYZ%3D&query=[{"id":"123","objectIds":["5"]}]
def getPoint = Action.async{
val data = Json.obj(
"id" -> "123",
"objectIds" -> Json.arr("5")
)
val ws = WS.url("http://myGisServer.ru/myservice").withQueryString(
"token" -> currentToken,
"query" -> data.toString()
)
val futureResponse: Future[WSResponse] = ws.get()
futureResponse.map(response => {
Ok(response.json)
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question