1

I am retrieving the data with this code

 Alamofire.request(urlString, method: .post, parameters: parameters,encoding: JSONEncoding.default, headers: headers)
        .responseString() { response in
            switch response.result {
            case .success(let data):
                let jsonData = JSON(data)
                print(jsonData)
                
            case .failure(let error):
                print("\(error) - hello world")
            }
    }

and the result that has sent by the server is

{"result":"Opertion is successfull"}

but i just want the value part "Opertion is successfull"

Kaveh Naseri
  • 1,102
  • 2
  • 15
  • 24

1 Answers1

1

Use the code from the almofire documentation

Alamofire.request(urlString, method: .post, parameters: parameters,encoding: JSONEncoding.default, headers: headers)
    .responseString() { response in
        if let jsonData = response.result.value {
            print("JSON: \(jsonData)") // serialized json response
        }
}
Marco Weber
  • 829
  • 10
  • 19