title: how i can make a HTTP request with Swift 3?
body: <p>Im learning about Swift and i trying to make an HTTP request. My code is working but i dont know how to  return the result of the request:</p>
  
  <pre><code>func makeRequest(request: URLRequest)-&gt;String{
      let task = URLSession.shared.dataTask(with: request){data, response, error in
          guard let data = data, error == nil else{
              print("error=\(error)")
              return
          }
  
          if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 {           // check for http errors
              print("statusCode should be 200, but is \(httpStatus.statusCode)")
              print("response = \(response)")
          }
          print (data)
          do {
              let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
              print(json)
          } catch {
              print("error serializing JSON: \(error)")
          }
          //print("responseString = \(responseString)")
  
      }
      task.resume()
      return "Something"//i need to return the json as String
  }
  </code></pre>
  
  <p>Someone can help me please? i was trying using CompletionHanlder but all the example that i found is based on swift 2, and this causes error on my code</p>
  
  <p><a href="https://i.stack.imgur.com/o0coP.png" rel="nofollow"><img src="https://i.stack.imgur.com/o0coP.png" alt="enter image description here"></a></p>