title: The data couldn’t be read because it isn’t in the correct format - HTTP network
body: <p>code </p>
  
  <pre><code>    let session = URLSession.shared
  
      // prepare json data
      let json: [String: Any] = ["email": "test_mobile@mysite.com"]
  
      let jsonData = try? JSONSerialization.data(withJSONObject: json)
  
      let proceedURL = NSURL(string:"https://mysitename.herokuapp.com/api/users/isUser")
      //let proceedURL = NSURL(string:"https://google.com")
      let request = NSMutableURLRequest(url: proceedURL! as URL)
      //HTTP Headers
      request.addValue("application/json", forHTTPHeaderField: "Content-Type")
      request.addValue("application/www.inception.v1", forHTTPHeaderField: "Accept")
      request.addValue("Authorization", forHTTPHeaderField: "Basic aW5jZXB0aW9uQGZ1cmRvOmljM=")
      request.httpMethod = "POST"
      //request.httpBody = jsonData
  
  
      // insert json data to the request
      request.httpBody = jsonData
  
      //create dataTask using the session object to send data to the server
      let task = session.dataTask(with: request as URLRequest, completionHandler: { data, response, error in
  
          guard error == nil else {
              return
          }
  
          guard let data = data else {
              return
          }
  
          // Print out response string
          let responseString = NSString(data: data, encoding: String.Encoding.utf8.rawValue)
          print("responseString = \(responseString!)")
  
          do {
              //create json object from data
              if let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: AnyObject] {
                  print(json)
                  // handle json...
              }
  
          } catch let error {
              print("error : " + error.localizedDescription)
          }
  
      })
  
      task.resume()
  </code></pre>
  
  <p>error :
  The data couldn’t be read because it isn’t in the correct format.</p>
  
  <p>I am beginner in iphone app development, help me on it and give better suggestion for make network connection (like in android i am using Volley library )  </p>
  
  <p>Actual Response is :</p>
  
  <pre><code>{
    "status": 1,
    "http_status_code": 200,
    "data": {
      "email": "test_mobile@mysite.com",
      "phone": "8090909000"
    }
  }
  </code></pre>
  
  <p>i am using same on Android and test in postmen.</p>
  
  <pre><code>// Print out response string
          let responseString = NSString(data: data, encoding: String.Encoding.utf8.rawValue)
  </code></pre>
  
  <p>for upper code response is nothing</p>