Can't upload binary data via RestKIT 0.22 - server receives 0 length stream

19 views
Skip to first unread message

Ariel .b

unread,
Feb 4, 2015, 4:12:09 AM2/4/15
to res...@googlegroups.com

Hi, would love to get some assistance:

(also in stack overflow)

http://stackoverflow.com/questions/28305245/cant-upload-binary-data-via-restkit-0-22-server-receives-0-length-stream



our server is WCF and has a method that accepts binary data and stores it:

[WebInvoke(Method = "POST", //@WSF-687
     BodyStyle = WebMessageBodyStyle.WrappedRequest,
     ResponseFormat = WebMessageFormat.Json,
     UriTemplate = "File/{fileName}")]
ContentResponse UploadFile(string fileName, Stream fileStream);

our client side is objective-c and we are trying to post an object (image / etc...) to the server using RESTKit - but the stream in the other side is always 0 with no content...

Restkit code:

NSData* rawData //this is the data we want to send
[[RKObjectManager sharedManager] postObject: data path:OUR_SERVER_PATH parameters:nil success:nil failure: nil]

the call succeeds but the server receives empty stream..

when we used another method of creating form data - it worked but it appended the form data to the content which is problematic (we need it raw).


it was suggested to not use RESTKit - but it seems weird?


anything we missed?

thanks!



Reply all
Reply to author
Forward
0 new messages