From 4165b9481b1b3f773185d42c29d613dce35360e0 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Wed, 16 Mar 2022 15:06:57 +1100 Subject: Use public URL for dummy API JSON Remembered I actually had a public server for me to dump files on lol --- foray/ForayTableViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'foray') 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!) -- cgit