# URLSession Tutorial: Getting Started | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/urlsession-tutorial-getting-started-raywenderlich-com/73741>\
**Category:** 🎓 Courses & Articles\
**Created:** [June 13, 2019, 5:38am UTC](https://forums.kodeco.com/t/urlsession-tutorial-getting-started-raywenderlich-com/73741 "2019-06-13T05:38:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![hasaan.ali2003](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hasaan.ali2003/32/109393_2.png) [@hasaan.ali2003](https://forums.kodeco.com/u/hasaan.ali2003)\
**Post date:** [December 27, 2019, 1:09pm UTC](https://forums.kodeco.com/t/urlsession-tutorial-getting-started-raywenderlich-com/73741/13 "2019-12-27T13:09:35Z")

</div>

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. 🙂

---

_[View the full topic](https://forums.kodeco.com/t/urlsession-tutorial-getting-started-raywenderlich-com/73741)._
