在httpPost中,我们使用setEntity(new StringEntity)。但是我现在正在使用volley。我想在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"));