Hi, i had successfully fetched data from a URL but i cannot figure out why its sub link from the same domain, does not fetch any data. it always shows nil, but it contains byte like 39962 bytes.
If it is nil, shouldnt that be something like 0 bytes
Sample url is this.
https://earthquake.phivolcs.dost.gov.ph/2022_Earthquake_Information/September/2022_0922_1059_B2.html
This is how I fetch the data from url
URLSession.shared.dataTask(with: URL(urlString)) { (data, response, error) in
guard let data = data else {
completion(nil)
return
}
if error != nil {
completion(nil)
}
else {
print(data)
completion(String(data: data, encoding: .utf8))
}
}.resume()
Thoughts? What could be wrong?
If it is https://earthquake.phivolcs.dost.gov.ph, i can fetch its data without issues.