I want to upload one image to server using http post method. the requirement is like in the body data should be attached as byte stream.
I converted image to NSData
and attached that data to body of NSUrlrequest
.
but i am getting 404 in status code of response.
NSMutableData *body = [NSMutableData data];
[body appendData:[NSData dataWithData:UIImageData]];
[request setHTTPBody:body];
but i am getting 404 error in status code.
is byte stream is same as NSData
?
if not then how to send byte stream data to server using NSURLConnection
?
Thanks in advance.