aboutsummaryrefslogtreecommitdiff
path: root/foray
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-16 15:06:57 +1100
committerNicholas Tay <nick@windblume.net>2022-03-16 15:08:35 +1100
commit4165b9481b1b3f773185d42c29d613dce35360e0 (patch)
tree50fd9ddffe4512856e28b81926a49caa6fd6c665 /foray
parent912fe67828b25b837c90a5abe96c0633cb9b27fc (diff)
downloadforayios-4165b9481b1b3f773185d42c29d613dce35360e0.tar.gz
forayios-4165b9481b1b3f773185d42c29d613dce35360e0.tar.bz2
forayios-4165b9481b1b3f773185d42c29d613dce35360e0.zip
Use public URL for dummy API JSON
Remembered I actually had a public server for me to dump files on lol
Diffstat (limited to 'foray')
-rw-r--r--foray/ForayTableViewController.swift8
1 files changed, 5 insertions, 3 deletions
diff --git a/foray/ForayTableViewController.swift b/foray/ForayTableViewController.swift
index 35d8052..ae8ff25 100644
--- a/foray/ForayTableViewController.swift
+++ b/foray/ForayTableViewController.swift
@@ -108,11 +108,13 @@ class ForayTableViewController: UITableViewController {
// PenguinItem(type: .quest, releaseDate: parseDate("2009-04-18"), id: "cmc", name: "Case of the Missing Coins"),
// ]
- var request = URLRequest(url: URL(string: "https://.../dummy.json")!)
- let authData = ("..:..").data(using: .utf8)!.base64EncodedString()
- request.addValue("Basic \(authData)", forHTTPHeaderField: "Authorization")
+ var request = URLRequest(url: URL(string: "https://users.windblume.net/~nick/upload/dummy.json")!)
request.cachePolicy = .reloadRevalidatingCacheData // Needed otherwise default caching policy seems not to check properly
+ // Basic auth if required
+ //let authData = ("ext:PASSWORD").data(using: .utf8)!.base64EncodedString()
+ //request.addValue("Basic \(authData)", forHTTPHeaderField: "Authorization")
+
URLSession.shared.dataTask(with: request, completionHandler: { data, response, error -> Void in
print("finished getting data")
print(response!)