java发送post请求

来源:互联网 发布:华东理工大学知乎事件 编辑:程序博客网 时间:2024/05/22 13:15
private String sendPost(String param) {        Request request = Request.Post(api).bodyString(param, ContentType.APPLICATION_FORM_URLENCODED.withCharset(Consts.UTF_8));        try {            return request.execute().returnContent().asString();        } catch (IOException e) {            e.printStackTrace();        }        return "";    }