tags:

views:

26

answers:

1

hi iam working in simple application in which i need to post data to the server using webservices but ipost string data to the web server but it give an error" large amount of binary data will be truncated " my code for above sending is below

NSString *queryString = [NSString stringWithFormat:@"url/message=%@",strMessage]; queryString = [queryString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSURL *url = [NSURL URLWithString:queryString]; NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [req addValue:0 forHTTPHeaderField:@"Content-Length"]; [req setHTTPMethod:@"GET"]; NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:req delegate:self];

        plz helps us above problem plz give any helps or code snnipet

thanks in advance

A: 

Hello !

Did you try http://allseeing-i.com/ASIHTTPRequest/ ?

You can post any kind of datas. For example to send an image :

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"Ben" forKey:@"first_name"];
[request setPostValue:@"Copsey" forKey:@"last_name"];
[request setFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photo"];

(from http://allseeing-i.com/ASIHTTPRequest/How-to-use)

Good Luck ! :-)

Vinzius