1
When sending a post I received by retrofit in the log the message Networkerror: 400 Bad Request.
In Development Environment no error occurs, data is synchronized from device to Server ( Tomcat ) from my internal network successfully.
I published the system, on the device I configured the URL, and while trying to transmit the data I get Networkerror: 400 Bad Request
http://200.187.136.7:8080/nova/fw.rule?sys=TSE&usuario=teste&metodo=fw_addSessao¶metros=7b911e32-1432-45c3-8ee0-e316bad7a2f7|2|15/01/2017%2023:19:44|15/01/2017%2023:22:01|e8b5ed5c-d1bf-43c2-a7ad-cdb7699cc496|Outros|Teste%20|-7.99032|-34.8935
The parameters are:
sys=TSE
usuario=teste
metodo=fw_addSessao
parametros=7b911e32-1432-45c3-8ee0-e316bad7a2f7|2|15/01/2017%2023:19:44|15/01/2017%2023:22:01|e8b5ed5c-d1bf-43c2-a7ad-cdb7699cc496|Outros|Teste%20|-7.99032|-34.8935
everything is sent in text, the last parameter has concatenated various information like Id of the record, latitude, longitude and I used as bounder the pipe "|" and for what I am noticing the problem is it, but in my internal network has no problem with its use.
You say that in Amabiente development does not occur errors, that means that when available for production this error happens? You checked if the URL is correct?
– viana
Yes the url is correct, and once I got it from the AE log, I did the following where the "|" was changed to ";" then the error became the 500 that indicates an error in the Server or POST arrived on the server and as my rule of business waits for a delimiter and arrived another the routine broke.
– Robson
Try using the URL ENCODE. This problem you are giving is a request. You are not making the request correctly on the server.
– viana
See: http://www.url-encode-decode.com/
– viana
Hello Ack Lay good afternoon, understood well would be to pick up the text where I have several concatenated information and make a meeting on it? and on the server a Decode?
– Robson
Exactly. Try this, maybe there are some characters that are conflicting with default characters of the URL and is giving problem in the interpretation.
– viana