I need to do an HTTP POST for a page that simply returns a literal (which can be “OK” or “ERROR”) I have a web tutorial that shows how to do this and it returns a JSON, I follow the tutorial and it works perfectly .
My problem is exactly there … it returns a JSON and what my site returns is not a JSON but a simple literal ..
How do I get this literal that the site is returning … I’ve tried several changes in the code below but without success.

let parameters = ["username": "@kilo_loco", "tweet": "HelloWorld"]

guard let url = URL(string: "") else { return }
var request = URLRequest(url: url)
request.httpMethod = "POST"
//request.addValue("application/json", forHTTPHeaderField: "Content-Type")
guard let httpBody = try? parameters, options: []) else { return }
request.httpBody = httpBody

let session = URLSession.shared
session.dataTask(with: request) { (data, response, error) in
    if let response = response {
        print ("*******")

    //print(data as Any)

    if let data = data {
        print("** TESTE **")
        //do {
          //  let json = try JSONSerialization.jsonObject(with: data, options: [])
        //} catch {
          //  print(error)
       // }


The Last “Print (data) returns the size in bytes and not the contents of the literal ..

You are missing parse Data to JSON Object, I think you have that code almos there but commented

        do {
            let json:AnyObject? = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
            if let parseJSON = json{

Hope this helps you