gpt4 book ai didi

android - HttpPost + setEntity : how to know content-length?

转载 作者:太空宇宙 更新时间:2023-11-03 13:25:59 27 4
gpt4 key购买 nike

<分区>

我已经设置了几乎所有的数据:

String capcha = editText.getText().toString();
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("myurl.asp");

// Add your data
String str = "param1=x&param2=y";
StringEntity strEntity = new StringEntity(str);
httppost.setEntity(strEntity);

httppost.setHeader("Set-Cookie", sessionCookie);
httppost.setHeader("Accept", "text/html");
httppost.setHeader("Content-Type", "application/x-www-form-urlencoded");
// httppost.setHeader("Content-Length", ); HOW TO GET CONTENT LENGTH ?

// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);

感谢您的帮助。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com