How exactly do parameters pass values?

First point out the correct example, and then proceed to the story of the narration......Copy the code

Unlike Java, PHP allows GET/POST values to be placed in collections, whereas Java (using Spring’s practice test here) does not.

As shown in figure 1:



I may not be accurate, but in practice it is true, maybe my colleague who does PHP has done the processing, GET mode whether in the collection or concatenated URL, can be correctly requested; Post is fine, it must be in a HashMap;

On the JAVA backend, the GET parameter must be a concatenated URL, as shown in Figure 2 (the red slash is the error of the previous parameter) :

What happened

A few days ago, I got a Java interface, I need to call it, it is very simple, pass the user’s token, but I used volley to call it, servererror was always the servererror, but there is no problem on PC, temporarily I used xutils to make the request, it is correct, my classmate said there is something wrong with the framework. There was a lapse in control and a lack of referrals. But I always thought Volley couldn’t be so vulnerable, so he used Fillder to capture; First time, grab Volley’s bag: Returned by the server data is clear, the lack of the “token” this parameter, then grabbed a volley with POST request (but the somebody else’s development documentation specified GET), so the parameter is passed, but the backend is returned data do not support the POST, so you can determine the document didn’t write wrong, finally I consulted with a more severe of the great god, As soon as he looked at my figure 1, he pointed out the problem: GET cannot be passed in a collection. And then he makes the hypothesis that he started with;

This problem finally solved, if you still do not understand, welcome to contact me!