Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
URI builder ignoring some parameters

I came across a problem that has me worried, I use URI bulder in my app to build the urls i use to transmit data between the app and my web server, like this:

Uri.Builder builder = new Uri.Builder()
    .appendQueryParameter("myData", fullData)
    .appendQueryParameter("device", Build.SERIAL)
    .appendQueryParameter("logintoken", token);
String query = builder.build().getEncodedQuery();

I have several different connections building urls like this, and it has been working fine up until recently I discovered that one of them was not including the device or login token in the final query, which then causes problems with data not validating. The myData field can be lengthy, in this specific case it was around 4000 characters which doesn't seem too large, I know for a fact it has worked with much larger data. And after searching around I couldn't find anything mentioning a size limit on these specific methods, as long as your server isn't restricting the limit it should be good.

After a while of trying to figure out why i ended up just switching the variables around so the device and login were first and the data was at the end and it worked.

Uri.Builder builder = new Uri.Builder()
    .appendQueryParameter("device", Build.SERIAL)
    .appendQueryParameter("logintoken", token)
    .appendQueryParameter("myData", fullData);
String query = builder.build().getEncodedQuery();

My Question is why? I couldn't find anything in the documentation that would suggest anything like this would happen, and it seems like a crappy workaround that just relies on hoping it wont happen in other places as well. I don't think I have any queries that use multiple large parameters, but im assuming one would get lost based on what was happening to me.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda