How to POST integer request to server in swift ios? -


    let therequest = nsmutableurlrequest(url: url!)     therequest.httpmethod = "post"      let parameters = ["otp":firstdigit.text!,"otp":seconddigit.text!,"otp":thirddigit.text!,"otp":fourthdigit.text!] dictionary<string,string> 

how add parameters pass numbers in server side. there 1 field in server side , have pass 4 integers using 4 different text fields. how can pass it? passing otp(one time password 4 digits)

first make otp variable this:-

 var otptext:string= firstdigit.text + seconddigit.text +thirddigit.text+fourthdigit.text 

then form parameter:-

let parameters : nsdictionary =["otp":otptext] 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -