how to send a token per head to a webservice in swift 4?

0

I have a code to send data to a web service that supposedly sends the token, but apparently it is wrong because the token does not reach the server, I hope you can help me. my code is this:

     let token = "eyJ0enssnsuwew"

    let url = URL(string: "http://webservice")
    var request = NSMutableURLRequest(url: url!)
    request.httpMethod = "POST"
    request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
    request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
    
asked by Russel Ramirez 22.03.2018 в 17:39
source

0 answers