需要帮助找到与下面有效的java代码相对应的相应curl命令语法。
工作 Java
HttpPost httppost = new HttpPost("/SEMP");
httppost.addHeader("Authorization", "Basic U1ZDLlNPTFJPRTE6anVXMmFfdVc=");
StringEntity stringEntity = new StringEntity("<rpc>command</rcp>", "UTF-8"); stringEntity.setContentType("text/xml");
httppost.setEntity((HttpEntity)stringEntity);
CloseableHttpResponse response = httpclient.execute(targetHost, (HttpRequest)httppost, localcontext);
需要相应的 Curl 语法吗? 请帮助了解curl的相应语法
提前致谢。
最佳答案
检查 curl
手册页。特别是-u部分。
关于java - 在 Linux 中使用 CURL 进行 HTTP POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31594270/