`
hallywang
  • 浏览: 7108 次
  • 性别: Icon_minigender_1
  • 来自: 南京
文章分类
社区版块
存档分类
最新评论
文章列表
mac下用  在安装好 pyenv之后,使用pyenv install 3.6.3 后报错:   copying build/lib.macosx-10.12-x86_64-3.6/__pycache__/_sysconfigdata_m_darwin_darwin.cpython-36.opt-1.pyc -> /Users/apple/.pyenv/versions/3.6.3/lib/python3.6/lib-dynload/__pycache__ dyld: lazy symbol binding failed: Symbol not found: _utimensat ...
  如下是简单的写法:   URL url = new URL("http://127.0.0.1:8080/json/"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setReadTimeout(30 * 1000); // 缓存的最长时间 conn.setDoInput(true);// 允许输入 conn.setDoOutput(true);// 允许输出 ...
搜了很多答案,都不对 在这记录一下 httpURLConnection 默认发送的 头信息 accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 没有 application/json .  因此会报错  415 错误 – 不支持的媒体类型(Unsupported media type)   其实服务端已经收到了请求,并且正常返回了数据,因此解决方法是,调用的时候 accept 中增加application/json    暴力的方法: httpURLConnection.setRequestProperty( ...
Global site tag (gtag.js) - Google Analytics