When I try to send a post request to a specific site, the string I attempt to send converts is. When I check the length of the string in the exode, it is about 55000 characters long. The number of characters received on the site is approximately 4500. This is my code:
- (IBAction) Convert {NSString * rosterText = [Webview stringBuViewing javaScriptFromString: @ "document.documentElement.innerHTML"]; NSString * params = [[NSString alloc] initWithFormat: @ "roster =% @", roster text]; NSString * paramsLength = [NSString stringWithFormat: @ "% d", [parameter length]]; NSMutableURLRequest * Request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @ "http: //www.thesite/index.php"]] ;; [Set http system: @ "post"]; [Request Set Value: HTTP HeaderField for @ "App / X-www-Form-URLXode": @ "Content-Type"]; [Request Set Value: paramsLength forHTTPHeaderField: @ "Content-Length"]; [Request Setttbbb: [Parameter Data Wrapping Encoding: NSUTF 8 String Encoding]]; NSLog (@ "length =% @", Paramma Lang); [WebView loadRequest: request]; [Paramax release]; [Request release];
}
I have a form on the site where you manually enter the string and all works well, so I think there is something wrong with encoding The posting data is happening.
Is anyone going wrong to know this? Just do not understand it!
Thanks a lot!
I'm not sure what's going wrong, but I suggest you use it .
It is easy to use the wrapper around the ASHTTPRCC seafnetwork API, which makes some of the more difficult aspects of communication easier with the web server, it is written in Objective-C and both Mac OS Works in X and iPhone applications.
Comments
Post a Comment