Hello, I am trying to use the OData Client of Objective-C library on a Odata service I created in my application.
Entities management works fine, however when trying to use the setSaveStream method I get the error:
The content type 'plain/text;charset=utf-8' is not supported. (Http error 415).
My service is based on a MSDN sample called "PhotoService", it's written in C# and runs on a IIS7 web server. (http://msdn.microsoft.com/en-us/library/ee960144.aspx)
This happens if I am trying to create a new entity as well as if I am trying to add the stream (a picture) to an existing entity.
The code is as follows:
Model_Box *newItem = [[Model_Box alloc] init];
NSData *pictureData = [NSData dataWithContentsOfFile:self.pictureFile];
[proxy setSaveStream:newItem stream:pictureData closeStream:NO contentType:@"image/jpeg" slug:@"nuovofile.jpg"];
This is taken exactly from the documentation. *newItem is an item that does not exist already in the entities collection, it should be created when this code is executed.
And in fact, if I remove the "setSaveStream" line, the insertion works fine.
Thank you in advance for replies. If there are anything I can do to better clarify the issue please let me know.