Skip to main content

Posts

Showing posts with the label nsurlrequest

dose setHTTPBody need an encoding type

dose setHTTPBody need an encoding type if you are passing it a NSMutable data type though a NSData in the method parameter? Basically I have a method which creates my http body packet along the lines of this - (void) constructRequest { //Create final packet NSMutableData * myConstructedMutableDataPacket = [[NSMutableData alloc] init]; [myConstructedMutableDataPacket appendData:Sig]; [myConstructedMutableDataPacket appendData:Ver]; //etc //call connection method [self [self VehicleSearchRequest:myConstructedMutableDataPacket]; } ]; } then in the connection method is where i declare all my request stuff. Also I am passing the NSMutableData object myConstructedMutableDataPacket over to the NSData parameter of my connection class as listed below. - (IBAction)VehicleSearchRequest:(NSData *)postBodyData { //all my connection crap NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0