The same request parameter returns different json message formats.

I use the java program request interface encapsulated by okhttp to return a message of type key. I use the same input parameter to get the message returned by the postman request, and this key is of type JSONarray. The postman returned is correct. How did that happen?


PS:
:

Mar.14,2021

is it possible that the attributes such as Content-type in the request header are different?
you can try setting okhttp according to the request header of Postman


this depends on how okhttp parses json. If it transforms the list of size=1 into an object by default, you can try to insert a few more pieces of data into that array

.
Menu