mercredi 5 septembre 2018

Swift 4 Open Safari with params

I want to write payment with link... i user Safari as default browser with this code:

UIApplication.shared.open(payURL!, options: [:], completionHandler: nil)

i want to pass params to body:

let q1 = URLQueryItem(name: "name", value: "Vladimir")
let q2 = URLQueryItem(name: "email", value: "email@email.com")
let q3 = URLQueryItem(name: "amount", value:  "50")

and this to header

"Content-Type", "application/json/x-www-form-urlencoded"

"Accept", "application/json; charset=utf-8"

UPDATED:

payURL: http://a954032.had.su/api/v1/robokassa/generate-url

method: POST




Aucun commentaire:

Enregistrer un commentaire