first of all I am sorry for this kind of questions, I am a little confused with Objective C, the function I am trying to write is to upload image to a server using web service, I have already dine it using C# but it I cann't figuir out what is the problem in my objective-C code
the C# code is:
using(var wb=new WebClient){
var Data=new NameValueCollection();
data["image"]=base64(fileName)/*base64 is a function to convert the image with"file name" to base64 string*/
Uri myUri=new Uri("http://localHost:8080/test2/sss/users/1/uploadImage");
var respose=wb.UploadValues(myUri,"Post",Data)
}
the Objective-C code I am trying to use:
NSData* data = UIImageJPEGRepresentation(theImageView.image, 1.0f);
[Base64 initialize];
NSString *strEncoded = [Base64 encode:data];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setHTTPMethod:@"POST"];
[request setURL:[NSURL URLWithString:@"http://localHost:8080/test2/sss/users/1/uploadImage"]];
NSData* image= [strEncoded dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES ];
NSLog(@"%@",strEncoded);
[request setHTTPBody:image];
(void)[NSURLConnection connectionWithRequest:request delegate:self];
sorry again but the problem is that I don't Know if I am matching the parameters right