Hello
I would like to concatenate 2 inputs bytes (or more) like:
var a: byte = 0x41
var b: byte = 0x42
var data = [a, b]
And then transmit these into a post request:
let client = newHttpClient()
let body = data
response = client.request(url, httpMethod = HttpPost, body = $body)
But when i look at wireshark, i don't have AB (4142) in the body.
Of course, if i want byte it is because i could have some bytes that are non printable like 0x01 and 0x02 and so on
Any tips?
thank in advance
string and char can contain non printable bytes, including 0x00 Your problem here is $data == "[65, 66]" You could overload $ for openArray[byte] or just use a string in the first place
let a = '\x41'
let b = `\x42`
let data = a & b