且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Apache HTTP客户端,POST请求.如何正确设置请求参数?

更新时间:2022-04-17 05:36:25

尝试一下:

        List <NameValuePair> nvps = new ArrayList <NameValuePair>();
        nvps.add(new BasicNameValuePair("IDToken1", "username"));
        nvps.add(new BasicNameValuePair("IDToken2", "password"));

        httPost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));