aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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!)