playframework - What happens if WSRequest has too many get() parameters? -


i have rather bizarre question , not find answer anywhere. building wsrequest request in play! 2.4.3 , adding query params using setqueryparameter() request. after that, send them server using request.get() , retrieving result.

everything works fine, curious, happen if parameters exceed limit of get(). need check , make 2 individual requests? handled somewhere or return exception?

thanks

i did not see numbers in documentation, know - there no limit query string in standards, it's depend realisation. what maximum possible length of query string?. pretty sure server can stuck in problem long query string before server.

my proposed solution check simple code:

package controllers;  import javax.inject.inject;  import play.*; import play.mvc.*;  import play.libs.ws.*; import play.libs.f.promise;  public class application extends controller {      @inject wsclient ws;      public promise<result> index() {         wsrequest request = ws.url("http://httpbin.org/get");         int paramsnumber = 100;         for(int i=0; i<paramsnumber; i++){           request.setqueryparameter("paramkey" + i, "paramvalue" + i);         }         return request.get().map(response -> ok(response.getbody()));     }  } 

so, "http://httpbin.org/get" takes 100 params (and play can create , send of course). , 1000 params returns "414 request-uri large" play still able create , send 1000 params without error.

i pretty sure question not in max param numbers in max query string length.

update

i run netcat echo locally - nc -l 8888 , did request url http://127.0.0.1:8888 100000 parmeters, &paramkey99999=paramvalue99999 - works charm. can answer: play 2.4.3 can send @ least 100000 params in the ws request totaly length of 2 600 000 chars. sure suppose have more parameters ?


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -