Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Swift by ben ( 6 years ago )
if let url = URL(string: "https://landing-sandbox.foodvisor.io/itw/food/list/?foo=bar") {

    var request = URLRequest(url: url)
    request.addValue("Bearer iwn-31@!3pf(w]pmarewj236^in", forHTTPHeaderField: "Authorization")
    request.httpMethod = "GET"
    print(request)
    URLSession.shared.dataTask(with: request) { data, response, error in
        print("data:\(data)")
        print("response:\(response)")
        print("error:\(error)")
        
   }.resume()
}

 

Revise this Paste

Your Name: Code Language: