且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

" java.lang.IllegalStateException:不能设置请求属性连接而成&QUOT后;错误的Andr​​oid

更新时间:2023-01-14 18:52:10

不被'URL.openConnection()创建的连接。'当你输入或错误流或响应code已创建

The connection isn't created by 'URL.openConnection().` It is created when you get the input or error stream or the response code.

NB,你不应该叫 setDoOutput(真),除非你打算怎么办输出,你是不是在这里。它集HTTP方法POST。

NB you shouldn't call setDoOutput(true) unless you are going to do output, which you aren't here. It sets the HTTP method to POST.