Convert CURL to URLRequest
问题 I’m trying to converting the the following curl request Swagger gives me to URLRequest: curl -X GET --header 'Accept: application/json' --header 'Authorization: key ttn-account-v2.<app-key>' 'https://<app-id>.data.thethingsnetwork.org/api/v2/query' URL and Headers are set correctly. Still I get the response: 401 - Not authorized. let key = "ttn-account-v2.<app-key>" let url = URL(string: "https://<app-id>.data.thethingsnetwork.org/api/v2/query") var request = URLRequest(url: url!) request