Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

240
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda