简体   繁体   中英

How to pass form-data of body tag of URL using volley

How can I pass the data to form-data of body tag of URL in Volley ? here I show you screen shot which I tried with multiple request but not worked.

please help me. 在此处输入图片说明

Use getParams method to add body parameters to volley request

@Override
protected Map<String, String> getParams() throws AuthFailureError {

Map<String, String> params = new HashMap<>();
// the POST Body parameters:
if (pack.getParams() != null && pack.getParams().size() > 0) {
    params = pack.getParams();  
    return params;
}
return super.getParams();

}

Pack is wrapper class that contains address, bodyparams, passwords and more.

Create a Map<String, String> and put your body parameters inside it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM