title: HTTP Send Request Parameter in Swift
body: <p>i want to send request with username and password for getting authentication key from server, here is my code, i don't know how send to parameter with request, please help me for solve it.</p>
  
  <pre><code>let urlString = "http://services.84069.ir/Restful/PaymentService.svc/authenticate"
  func recentProfileURL(parameter : [String:String]?) -&gt; NSURL {
  
      let component = NSURLComponents(string: urlString)!
      var queryItem = [NSURLQueryItem]()
      if let param = parameter {
          for (key,value) in param {
              let item = NSURLQueryItem(name: key, value: value)
              queryItem.append(item)
          }
      }
      component.queryItems = queryItem
      return component.URL!
  }
  
  func fetchCode(completion completion: (ProfileResult) -&gt; Void){
  
      let request = NSURLRequest(URL: recentProfileURL(["UserName": self.userNameParam]))
  
      let task = session.dataTaskWithRequest(request, completionHandler: {
          (data, response, error)  in
  
          let result = self.processUserProfileRequest(data: data, error: error)
      completion(result)
      })
      task.resume()
  }
  </code></pre>
  
  <p>I'm trying send username and password for getting authentication code from server how can send array of parameter instead of one parameter?</p>