title: Error Domain=NSCocoaErrorDomain Code=3840 in Swift 4.1 (Xcode 9.3)
body: <p>I was creating the iOS app with MYSQL. In app I used below code.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
  //URL to our web service
  let URL_SAVE_TEAM = URL(string:"http://my_url/ios_api/api/createteam.php")
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  //TextFields declarations
  @IBOutlet weak var textFieldName: UITextField!
  @IBOutlet weak var textFieldMember: UITextField!
  
  @IBAction func buttonSave(_ sender: UIButton) {
  
      //creating NSMutableURLRequest
      let request = NSMutableURLRequest(url: URL_SAVE_TEAM!)
  
      //setting the method to post
      request.httpMethod = "GET"
  
      //getting values from text fields
      let teamName=textFieldName.text
      let memberCount = textFieldMember.text
  
      //creating the post parameter by concatenating the keys and values from text field
      let postParameters = "name="+teamName!+"&amp;member="+memberCount!;
  
      //adding the parameters to request body
      request.httpBody = postParameters.data(using: String.Encoding.utf8)
  
  
      //creating a task to send the post request
      let task = URLSession.shared.dataTask(with: request as URLRequest){
          data, response, error in
  
          if error != nil{
              print("error is \(error)")
              return;
          }
  
          //parsing the response
          do {
              //converting resonse to NSDictionary
              let myJSON = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
  
              //parsing the json
              if let parseJSON = myJSON {
  
                  //creating a string
                  var msg : String!
  
                  //getting the json response
                  msg = parseJSON["message"] as! String?
  
                  //printing the response
                  print(msg)
  
              }
          } catch {
              print(error)
          }
  
      }
      //executing the task
      task.resume()
  }
  
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  }
  </code></pre>
  
  <p>On that line of code, it show the below error. I have searched in google and can't find the solution. Please help me to fix this.</p>
  
  <pre><code>let myJSON = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
  </code></pre>
  
  <blockquote>
    <p>Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start
    with array or object and option to allow fragments not set."
    UserInfo={NSDebugDescription=JSON text did not start with array or
    object and option to allow fragments not set.}</p>
  </blockquote>