小编siv*_*iva的帖子

setRequestProperty抛出java.lang.IllegalStateException:连接后无法设置request属性

我得到了java.lang.IllegalStateException:

java.lang.IllegalStateException:setRequestProperty调用方法 后,无法在连接建立后设置请求属性url.openConnection();

这是我正在尝试的:

URL url = new URL("https://49.205.102.182:7070/obsplatform/api/v1/mediadevices/545b801ce37e69cc");
         urlConnection = (HttpsURLConnection) url
        .openConnection();
urlConnection.setRequestProperty("Content-Type","application/json");
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?提前致谢.

android

9
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1