android HTTP URL连接使用https,而不使用http

时间:2020-05-04 18:21:45

标签: java android http url connection

我尝试使用以下代码执行http GET。它可以完美地与https URL字符串一起使用,而不能与http url一起使用。

我不明白为什么。给出了IOException。 你能帮我吗?我尝试使用和不使用https检索相同的URL,例如google,后者正在运行。怎么了我在清单中添加了用户访问Internet的权限。

flask_server.config['PERMANENT_SESSION_LIFETIME'] = timedelta(minutes=15)

}

2 个答案:

答案 0 :(得分:0)

将此行添加到应用程序标记中的androidManifest.xml中,并尝试对其进行调试

#include <stdio.h>

int main()
  {
  int i = 0, direction = 1;
  int PORTD, array[8] = {10, 11, 12, 13, 14, 15, 16, 17};

  for (i = 0 ; i >= 0 ; i += direction)
    {
    PORTD = array[i];

    printf("i=%d array[%d]=%d\n", i, i, array[i]);

    if(i == (sizeof(array)/sizeof(array[0]))-1 )
      direction = -1;
    }
  }

答案 1 :(得分:0)