URLSession Tutorial: Getting Started | raywenderlich.com

Hi, the following query
urlComponents.query = "media=music&entity=songs&term=\(searchTerm)"

returns response with status 400 with following body:

{
“errorMessage”: “Invalid value(s) for key(s): [resultEntity]”,
“queryParameters”: {
“output”: “json”,
“callback”: “A javascript function to handle your search results”,
“country”: “ISO-2A country code”,
“limit”: “The number of search results to return”,
“term”: “A search string”,
“lang”: “ISO-2A language code”
}
}

I changed the query to
urlComponents.query = "term=\(searchTerm)"
and I got the response status 200 with app showing the results. Please update for posterity. Thanks. Very useful tutorial though. :slight_smile: