0

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....?

2
  • Did you got the solution ? Can you please share ? Commented Apr 11, 2013 at 8:07
  • Did you got the solution ? Can you please share ? Commented Jul 9, 2018 at 9:34

2 Answers 2

2

You can post any data with ASIFormDataRequest's setData. Here's an example.

Sign up to request clarification or add additional context in comments.

1 Comment

ASI will send it as a byte array.
1

You could create an NSData out of your bytes, and set that to the request using setData:.

NSData Class Reference

4 Comments

setData accepts only NSData object. But i need to send bytes to my server
NSData is just a OO wrapper around byte arrays.
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?
ASI will take care of serializing it while preparing the request body.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.