84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我使用volley 发送post请求,总是无法请求,在表单里提交是可以的,但是使用volley 发送post请求总是无法请求,请大神指点迷津
认证高级PHP讲师
Request<T>里有一个getHeaders()方法。可以覆盖添加自己的http header
Request<T>
getHeaders()
javapublic class MyRequest<T> extends Request<T>{ @override public Map<String, String> getHeaders() throws AuthFailureError{ Map<String, String> headers = new HashMap<String, String>(); headers.put("enctype", "text/plain"); return headers; } }
java
public class MyRequest<T> extends Request<T>{ @override public Map<String, String> getHeaders() throws AuthFailureError{ Map<String, String> headers = new HashMap<String, String>(); headers.put("enctype", "text/plain"); return headers; } }
Request<T>
里有一个getHeaders()
方法。可以覆盖添加自己的http header