Request to publish Android volleyball using name pairs

I use the volley library to create a mail request to the server. This library uses Map<String, String>for message parameters. My problem is that you have multiple values ​​for the same key that can be used NameValuePairs, but it cannot be used with volleyball. Thanks in advance!

+4
source share
1 answer

try overriding the method below, this is from the source code:

/**
 * Returns the raw POST or PUT body to be sent.
 *
 * @throws AuthFailureError in the event of auth failure
 */
public byte[] getBody() throws AuthFailureError {
    Map<String, String> params = getParams();
    if (params != null && params.size() > 0) {
        return encodeParameters(params, getParamsEncoding());
    }
    return null;
}

Returns the raw body of a POST or PUT.

getBody() .

0

Source: https://habr.com/ru/post/1568914/


All Articles