title: AFDataResponse : Convert data to JSON format Swift 5
body: <p>I implemented the following code </p>
  
  <pre><code>AF.request(url, method: .post, parameters: parameter, encoding: JSONEncoding.default).responseData(completionHandler: {response in
  
              print(response)
  
              switch response.result {
              case .success:
  
                  print(response.result)
                 let alertVC = self.alertservices.alert(title: "Add Recipe : Basic Level", message: "Your basic level recipe details has been submitted successfully!", cancelTitle: "Cancel", submitTitle: "Ok", alertimage: "recipes"){
                     self.detailContainerView.isHidden = false
  
                 }
                 self.present(alertVC,animated: true)
  
                  break
              case .failure :
                  let alertVC = self.alertservices.alert(title: "Add Recipe : Basic Level", message: "Something went wrong. Please try again!", cancelTitle: "Cancel", submitTitle: "Ok", alertimage: "recipes"){
  
                  }
                  self.present(alertVC,animated: true)
                  break
              }
  })
  </code></pre>
  
  <p>If I use <code>.responseData</code> then I get the this output <code>success(118 bytes)</code> instead of what is mentioned below. But the actual response which I get when I place the values in the postman is</p>
  
  <pre><code>{
      "response": "success",
      "status": 0,
      "recipe_id": 10422
  }
  </code></pre>
  
  <p>If I use <code>.responseJSON</code> then the following error is shown at the console.</p>
  
  <pre><code>["recipe_preparation_time": "00:10:00", "recipe_title": "test recipe", "recipe_category": "2", "veg_status": "1", "recipe_food_type[]": [1, 3], "type": "3", "recipe_cooking_time": "00:10:00", "recipe_country": "", "customer_id": "5", "added_by": "5", "difficulty_level": "1"]
  success({
      error =     {
          "recipe_food_type" =         (
              "The recipe food type field is required."
          );
      };
      message = "Validation Error";
      status = 406;
  })
  </code></pre>
  
  <p>Can anyone help me to solve this?</p>