The problem is two-fold. Webi sending duplicate requests behind the scene, and duplicated post data.
- Duplicated requests - Code as follows:
Webi.with(this)
.from(someURL)
.addPost("user", user)
.addPost("code", code)
.addPost("values", values)
.onResponse(new OnResponse() {
@OverRide
public void Response(String response, String where) {}
})
.setOnFailed(new OnFailed() {
@OverRide
public void failed(int code) {}
})
.setRetryTimes(0)
.connect();
LogCat shows that this function is called once, and success also reported once, but on server side, I see duplicated entries:
x.x.x.x - - [08/Mar/2018:07:30:15 +0000] "POST /xxx.php HTTP/1.1" 200 379 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Redmi Note 4 MIUI/V9.2.2.0.MBFMIEK)"
x.x.x.x - - [08/Mar/2018:07:30:15 +0000] "POST /xxx.php HTTP/1.1" 200 365 "-" "Dalvik/2.1.0 (Linux; U; Android 6.0; Redmi Note 4 MIUI/V9.2.2.0.MBFMIEK)"
Notice the requests are sent basically at the same time, with a slightly different payload.
- Post data duplication.
Logcat as follows:
com.ashrafi.webi.classes.PostDataBuilder: buildPostData: user=AAAA&code=BBBB&user=AAAA&code=BBBB&values=%5B%5B1520493226272%2C0%2C3.519%2C22.2803964%2C114.188337%2C0%2C0.0%5D%2C%5B1520493234846%2C0%2C0.086%2C22.2803964%2C114.188337%2C0%2C0.0%5D%5D
You can see in this example that user and code are duplicated. In other samples I also see "values" re-appearing (I did not check if the data is the same - too long).