1

I'm having a POST Request like below codes.I'm not passing any body with it.But how to make this request dynamic it means it should accept any mobile number which i'have entered in my mobiletextfield not the specific one like 0123456789

var request = URLRequest(url: URL(string: "myurl/register?mobileno=0123456789")!)
request.httpMethod = "POST"
TheMiss
  • 43
  • 7

1 Answers1

0

Let number to be value of mobile textfield:

var request = URLRequest(url: URL(string: "myurl/register?mobileno=\(number)")!)
request.httpMethod = "POST"
李骏骁
  • 571
  • 5
  • 13
  • hey and how to pass the parameters without textfield?. I mean having a scenario in which I have to pass the mobile number and otp for verification how should I do ? – TheMiss Jun 26 '17 at 10:33
  • @TheMiss I think you can wrapper it as a function, let the number to be a parameter. You can call this function after the verification is passed. – 李骏骁 Jun 27 '17 at 02:21
  • @ 李骏骁 hey it would be great help of mine if you will try to solve my this question. thanks in advance. https://stackoverflow.com/questions/44985996/how-to-create-a-multiple-autocompletion-textfields-which-works-as-a-filter-in-sw – TheMiss Jul 17 '17 at 04:26