请求页面:
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryzM0nS9GIodjxCMih
post参数:

------WebKitFormBoundaryzM0nS9GIodjxCMih
Content-Disposition: form-data; name="csrfmiddlewaretoken"

MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);

try {

        reqEntity.addPart("csrfmiddlewaretoken", new StringBody("XXX"));

        reqEntity.addPart("input_text", new StringBody("XXX"));

        reqEntity.addPart("output_text", new StringBody(""));

        } catch (UnsupportedEncodingException e) {

                // TODO Auto-generated catch block

                e.printStackTrace();

        }

        postRequest.setEntity(reqEntity);

        HttpResponse response;

        response = httpClient.execute(postRequest)

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐