Home>

I'm a rental server beginner.
A web page is created on the Sakura Internet rental server by practicing the program. (Light plan)
What we want to do is to set up a JSON file on the server and call the json file from an iPhone application (swift) created separately.

Error message

https://autoscreencast.com/2018-08-07-swiftui-decoding-json-ios-13-beta-5
I referred to the above site and first copied it and used it.

let todosEndpoint = "https://jsonplaceholder.typicode.com/todos/"
If the URL of the part is unchanged, the acquisition of the JSON file was confirmed, but

let todosEndpoint = "http: // my domain/json/test.json"
So I could not get it if I changed to the address of my rental server.

I haven't messed up the rental server settings,
Do you need any security settings?

By the way, if you enter http: // your domain/json/test.json in your browser, you can see the contents.

  • Answer # 1

    http communication is not allowed by default on current iOS.

    Enable https on the rental server or
    The app must allow http or not.

    Reference:
    https://qiita.com/uhooi/items/68939999c2c31e5f5557