I am developing an application which requiers me to convert an audio/video/image file into a 'BYTE ARRAY' and upload that to web services(REST) through a POST request. I am actually using ASIHTTPRequest (ASIFormData) to POST the data. But I could not find any class/method which will allow me to post the byteArray. Is there a way to do this....?
-
Did you got the solution ? Can you please share ?Janak Nirmal– Janak Nirmal2013-04-11 08:07:41 +00:00Commented Apr 11, 2013 at 8:07
-
Did you got the solution ? Can you please share ?Gaurav Borole– Gaurav Borole2018-07-09 09:34:02 +00:00Commented Jul 9, 2018 at 9:34
Add a comment
|
2 Answers
You could create an NSData out of your bytes, and set that to the request using setData:.
4 Comments
A for Alpha
setData accepts only NSData object. But i need to send bytes to my server
user1885297
NSData is just a OO wrapper around byte arrays.A for Alpha
But the backend server accepts only byteArray... Even though NSData is a OO wrapper around byte array, the internal structure of both differ... Any thoughts?
user1885297
ASI will take care of serializing it while preparing the request body.