title: unable to save the data to the json using post
body: <p>I m unable to save the data back to json which is written in text fields and when save button is clicked it have to save the updated data to json.
  Here is the code i have written on save button action:</p>
  
  <pre><code>if let id = UserDefaults.standard.string(forKey: "NgoId"){
          var request = URLRequest(url: URL(string: "http://www.shreetechnosolution.com/funded/ngo_profile.php?ngoid=\(id)")!)
          request.httpMethod = "POST"
          let postString = "Nameofngo=\(textngoname.text!)&amp;NameofChiefFunctionary=\(textcheiffunction.text!)&amp;NameofChairman=\(textchairman.text!)&amp;NameofSeceratary=\(textsecratary.text!)&amp;NameofTreasurer=\(texttreasurer.text!)&amp;ParentOrganization=\(textparentorg.text!)&amp;AboutNGO=\(Textngo.text)&amp;photoofNGO=\(imageviewngo.image)&amp;ngoid=\(id)&amp;value=NGO"
          request.httpBody = postString.data(using: .utf8)
          let task = URLSession.shared.dataTask(with: request) { data, response, error in
              guard let data = data, error == nil else {                                                 // check for fundamental networking error
                  print("error=\(error ?? "" as! 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 = \(String(describing: response))")
  
          }
              let json = try! JSONSerialization.jsonObject(with: data, options: []) as! NSDictionary
              let msg = json.value(forKey: "message") as! NSString!
  
  
  
              let alert : UIAlertView = UIAlertView(title: "Alert box!", message: "\(msg!).",delegate: nil, cancelButtonTitle: "OK")
              alert.show()
          }
          task.resume()
          }
  </code></pre>