URL url = new URL(address);
URL url = new URL(address);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setConnectTimeout(20000);
connection.setReadTimeout(300000);
connection.setRequestProperty("Charset", "UTF-8");
OutputStream os = connection.getOutputStream();
os.write(sb.toString().getBytes());
os.close();
is = connection.getInputStream();
解决方案:加入红色部分即可
分享到:
相关推荐
java.io.IOException: Server returned HTTP response code: 403 for URL 处理过程记录 BASIC AUTH2 POST接口,解决403问题
解决删除目录提示:System.IO.IOException: 目录不是空的
java.security.InvalidKeyException:illegal Key Size 微信开发过程中,JDK6的版本
本人的一片博客,http://blog.csdn.net/jackieriver/article/details/78882194,所需要的一些插件
Eclipse 进行 ANT 时错误 Javadoc failed java.io.IOException Cannot run program javadoc
把 java 代码直接改成 jsp,上传时产生 如下异常: 2012-12-31 8:59:21 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet jsp threw exception java.io.IOException: ...
it.sauronsoftware.jave.EncoderException: java.io.IOException: Cannot run program "C:\Users\moxiao\AppData\Local\Temp\jave-1\ffmpeg.exe": CreateProcess error=740, 请求的操作需要提升。 在最新的liunx ...
Http-Multipart-Data-Parser-master,如需要http post接口开发、http post传文件等操作可以参考,源码的最原始地址忘记了,这个是从上面down下来新版,各位可参考
复制并覆盖%JAVA_HOME%/jre/lib/security下的local_policy.jar 和 US_export_policy.jar
Android Build 时报错: java.io.IOException: Could not parse XML from android/accounts/annotati...Android构建时报错: app:lintVitalRelease[Fatal Error] :3:214: 与元素类型 “item” 相关联的 “name” ...
Java.io.IOException: The same input jar [E:\Android\myProgram\angel\libs\alipaySdk-20160825.jar] is specified twice. 首先 看一下我项目中关于此jar的配置,我在libs中导入了alipaySdk-20160825.jar,
报错:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.-附件资源
针对java.io.IOException: entity content is too long [180278508] for the configured buffer limit [157286400]异常,将 DEFAULT_BUFFER_LIMIT修改为150M
JSSE(Java Security Socket Extension) 是Sun为了解决在Internet上的实现安全信息传输的解决方案。它实现了SSL和TSL(传输层安全)协议。在JSSE中包含了数据加密,服务器验证,消息完整性和客户端验证等技术。通过...
android 二进制xml 解析。AXMLPrinter2反编译的时候报错解决
java安装路径Java\jre\lib\security下替换这两个架包,即可解决 java.security.cert.CertificateException: Unable to initialize, java.io.IOException: Short read of DER length
Exception in thread “main” java. lang . UnsatisfiedLinkError: org. apache . hadoop. io. nativeio. NativeIOSWindows . access0 (Ijava/ lang/String;I)Z 原因:在调用NativeIO中的...
1.写一段程序利用Scanner类扫描用户输入,假设用户输入: lvjia 37 D:\photo.jpg 将前两部分lvjia和37直接写入文件D:\test.bin;第三个部分是一个文件路径,检查文件(D:\photo.jpg)是否存在,如果存在将文件内容...
ORA-29532: Java call terminated by uncaught Java exception: javax.mail.MessagingException: IOException while sending message; nested exception is: javax.activation.UnsupportedDataTypeException: no ...