0

I have a set of header keys that I'm sending with a task. The issue comes when I'm looking on the server side and all the headers that contain a _ are skipped. How can I insert the _ in my header values? Using Unicode values? Using UTF-8? If so, where?

request.setValue("4435353", forHTTPHeaderField: "session_id")
request.setValue("08", forHTTPHeaderField: "channel-id")
request.setValue("5afde734-7655-406d-bda3-14ffa968d6ab", forHTTPHeaderField: "itau-client-id")
request.setValue("oO6oO3nW6iG8yV0kL6gU5yY1hE3qV6bH6yF0mK0tG4xX3qU2gD", forHTTPHeaderField: "itau-client-secret")
request.setValue("\(token_latam!)", forHTTPHeaderField: "token_latam")
request.setValue("itoken", forHTTPHeaderField: "application")
request.setValue("2017-12-12T12:30:00", forHTTPHeaderField: "timestamp")
request.setValue("c626ea51-edde-4172-8d16-1c2fd7700c13", forHTTPHeaderField: "itau-chave")
request.setValue("345353454", forHTTPHeaderField: "transaction_id")
request.setValue("\(encoded_operation!)", forHTTPHeaderField: "encoded_operation")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

Server Side:

{
  "itau-chave": "c626ea51-edde-4172-8d16-1c2fd7700c13",
  "accept": "*/*",
  "timestamp": "2017-12-12T12:30:00",
  "itau-client-secret": "oO6oO3nW6iG8yV0kL6gU5yY1hE3qV6bH6yF0mK0tG4xX3qU2gD",
  "itau-client-id": "5afde734-7655-406d-bda3-14ffa968d6ab",
  "channel-id": "08",
  "application": "itoken",
  "accept-language": "en-us",
  "accept-encoding": "br, gzip, deflate",
  "user-agent": "ItauPassEmpresa/1 CFNetwork/975.0.3 Darwin/18.5.0",
  "content-type": "application/json"
} 
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Schavcovsky
  • 81
  • 1
  • 2
  • 9

1 Answers1

0

just try to add : in prefix header name for more info read this HTTP::Headers

a.masri
  • 2,439
  • 1
  • 14
  • 32