-1

I need to send a image to server with Url the url looks as below

http://somewebsite.com:8080/app/api/fappname/newUser/1/Delhi481/cct/12 dk/11588/kmkr/72579/Los/TM/8:00/13:00/28.6100/77.2300/foto1.jpg/null

they asked me to send image in place of foto1.jpg, the code that now i'm using is as below i am sending null inplace of image i'm getting response. can any one send me how to send the image in this url.

 NSString *str = [NSString stringWithFormat:@"http://someurl.com:8080/app/api/kkknnmm/newUser/1/%@/%@/%@/%@/%@/%@/%@/TM/%@/%@/%@/%@/%@/%@/%@",[inSchoolName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],@"kktt",[inAddressStreet stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],inAddressNo,inAddressState,inZipCode,[inNeighbourhood stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[arrivalHR stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],[endingHr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],inlat,inlong,inImg1,inImg2,inImg3];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:str]];
NSLog(@"Login Url:%@",str);
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

can any one please help me.

user3252627
  • 25
  • 1
  • 13

1 Answers1

1

Well your Api Is expecting binary data, I would suggest you to go through these links.

I hope they Will Help you.

Have A look at this And this

Saad Chaudhry
  • 1,392
  • 23
  • 37