anybody know anything about html POST requests. I need to generate a POST request to work with voxBack to submit feedback. I could just add a webView for feedback, but it looks like balls, so I'm hoping that I can use native textFields to input the text and then generate a post request to replace the default voxBack form.
generic code for html POST in obj-c:
NSString *myRequestString = @"&myVariable1=Hello%20World&myVariable2=Ohai2u ";
NSData *myRequestData = [ NSData dataWithBytes: [ myRequestString UTF8String ] length: [ myRequestString length ] ]
NSMutableURLRequest *request = [ [ NSMutableURLRequest alloc ] initWithURL: [ NSURL URLWithString: @"http://www.google.com/" ] ];
[ request setHTTPMethod: @"POST" ];
[ request setHTTPBody: myRequestData ];
NSData *returnData = [ NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil ];
This will send the POST request:
http://www.google.com/&myVariable1=H...riable2=Ohai2u and place any data that comes back int the NSData object returnData
voxBack form:
Feedback