欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java 发起http post请求,java发起post请求,/** * Cr

来源: javaer 分享于  点击 43662 次 点评:267

java 发起http post请求,java发起post请求,/** * Cr


/**     * Creates the request "https://www.mycallaccount.com/ot/triggerID1.asp".     * Customer didn't provide public API for this service. Used Fiddler2 to     * grab data and emulate request through browser     *      * @param callbackNumber     *            callback number     * @return the http post     */    private HttpPost createRequestToMycallaccountSite(String callbackNumber) {        String value = String.format(                "Did=%s&Password=%s&LegBPhone=%s&tempCB=%s&B1=Trigger",                mSettings.getLogin(), mSettings.getPassword(),                Uri.encode(mDialingContact.getNumber()),                Uri.encode(callbackNumber));        HttpPost post = new HttpPost(                "https://www.mycallaccount.com/ot/Di_Trigger_Now31.asp");        ByteArrayEntity entity = new ByteArrayEntity(value.getBytes());        post.addHeader("Content-Type", "application/x-www-form-urlencoded");        post.setEntity(entity);        return post;    }
相关栏目:

用户点评