I am trying to use the HttpWebRequest for posting a byteArray at C#. i dont want to convert the bytes to string (or to ToBase64String). i just want to send the byteArray to the server as is. let say that my data is
byte[] byteArray = { 0, 1, 5, 4, 0, 1, 55, 0, 1, 5, 4, 0, 1}
what should i define at the post parameters?
request.ContentType = "application/x-www-form-urlencoded"??? or request.ContentType = "application/octet-stream";???
I think I am missing something big….(BTW, the server is WampServer (Koana,PHP,MySQL)
Thanks!
An easier way to do this would be to use a
WebClient:For binary data you usually would use
application/octet-stream– but this is not required (depends on the server), i.e. theWebClientupload above does not specify a content-type header.