【发布时间】:2014-04-07 18:15:38
【问题描述】:
在 httpPost 我们设置实体(新字符串实体)。但我现在正在使用凌空抽射。我想在 volley 中使用该 setEntity 方法。我该怎么做?
我想像这样将它与 Twitter api 一起使用;
HttpPost httpPost = new HttpPost(TwitterTokenURL);
httpPost.setHeader("Authorization", "Basic " + base64Encoded);
httpPost.setHeader("Content-Type", "application/x-www-form- urlencoded;charset=UTF-8");
httpPost.setEntity(new StringEntity("grant_type=client_credentials"));
【问题讨论】:
-
可能在 set headers 方法中,你必须重写 Request
对象才能在 volley 中做自定义的事情 -
嗨,我也在尝试做同样的事情,需要设置 StringEntity。你能帮我解决这个问题吗?你是怎么解决的。
标签: android apache android-volley