title: Data posting server gets error in swift 3?
body: <p>Here i got a token number from api like as shown here <code>"210"</code> and it is saving using userdefaults but when i tried to retrieve data from the userdefaults then it is returning <code>"\"210\""</code> like this why it is adding slashes and  quotes can anyone help me how to resolve this ?</p>
  
  <p>here is the code for posting key</p>
  
  <pre><code>request.addValue("application/json", forHTTPHeaderField: "Content-Type")
          request.addValue("Bearer \(self.CustomerToken!)", forHTTPHeaderField: "Authorization")
          print(self.CustomerToken!)
          let task = URLSession.shared.dataTask(with: request) { data, response, error in
              guard let data = data, error == nil else {                                                 // check for fundamental networking error
                  print("error=\(String(describing: error))")
                  return
              }
              if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 {           // check for http errors
                  print("statusCode should be 200, but is \(httpStatus.statusCode)")
                  print("response = \(String(describing: response))")
              }
  
              let responseString = String(data: data, encoding: .utf8)
              print("responseString = \(responseString!)")
              let status = (response as! HTTPURLResponse).statusCode
              self.keyStatusCode = status
              print(responseString!)
              self.customerCartIdNumber = responseString!
              self.customerCartIdNumber = responseString!
              UserDefaults.standard.set(self.customerCartIdNumber, forKey: "CustomerLoginNumber")
              print(self.customerCartIdNumber!)
              print(responseString!)
  </code></pre>
  
  <p>here is the code for getting key </p>
  
  <pre><code> let customerId = UserDefaults.standard.string(forKey: "CustomerLoginNumber")
              self.customerCartId = customerId!
              print(customerId!)
  </code></pre>
  
  <p>here is the code for posting</p>
  
  <pre><code>func customerAddToCartItemsDownloadJsonWithURl(cartApi: String){
          let url = URL(string: cartApi)
          var request = URLRequest(url: url! as URL)
          request.httpMethod = "POST"
          let cartNumber = customerCartId?.replacingOccurrences(of: "\\", with: "")
          let parameters : [String: Any] = ["cartItem":
              [
                  "quote_id": "\(customerCartId!)",
                  "sku": "\(itemCode!)",
                  "qty":"1"
              ]
          ]
          print(customerCartId)
          print(parameters)
          print(cartNumber)
          do {
              request.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: .prettyPrinted)
  
          } catch let error {
              print(error.localizedDescription)
          }
          request.addValue("application/json", forHTTPHeaderField: "Content-Type")
          request.addValue("Bearer \(self.customerKeyToken!)", forHTTPHeaderField: "Authorization")
          let task = URLSession.shared.dataTask(with: request) { data, response, error in
              guard let data = data, error == nil else {
                  print("error=\(String(describing: error))")
                  return
              }
  
              if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 {
                  print("statusCode should be 200, but is \(httpStatus.statusCode)")
                  print("response = \(String(describing: response))")
              }
  
              let responseString = String(data: data, encoding: .utf8)
              print("responseString = \(responseString!)")
          }
          task.resume()
      }
  </code></pre>