Note that there are some explanatory texts on larger screens.

plurals
  1. POASIFormDataRequest - iOS Application. How do I RETRIEVE a post variable
    text
    copied!<p>So I have this url that leads to a .php</p> <p>So far I managed to retrieve every single thing except the actual XML that I want. the XML is stored in a variable called _xml.</p> <pre><code>if($this-&gt;outMethod=="" || $this-&gt;outMethod=="POST") //Default to POST { $_POST["_xml"] = $_xml; } </code></pre> <p>So I've already set the outMethod to POST but I don't understand how to retrieve the value within _xml.</p> <pre><code>- (void)grabURLInBackground { NSLog(@"grab url in background"); NSURL *url = [NSURL URLWithString:@"xxxxxxxxxxx"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:@"POST" forKey:@"outMethod"]; [request setPostValue:@"1" forKey:@"Entity_ID"]; [request setDelegate:self]; [request startAsynchronous]; NSLog(@"end of grabUrlInBackgroun"); } </code></pre> <p>don't worry the URL is right I just don't want to post it.</p> <pre><code>- (void)requestFinished:(ASIHTTPRequest *)request { NSLog(@"A"); // Use when fetching text data NSString *responseString = [request responseString]; // Use when fetching binary data NSData *responseData = [request responseData]; if(responseString) { NSLog(@"responseData is not null"); } NSLog(@"response string: %@", responseString); //NSLog(@"%@", responseString); } </code></pre> <p>What I get back is that the request is good, but there is no response in responseString. This is because my php does not want to print out any of the XML on screen in HTML but it stores the result in the variable _xml sent via post "$_POST["_xml"] = $_xml</p> <p>My question is, how do I get back that xml variable? Isn't there a method available within the ASIHTTPRequest library? I am using ASIFormDataRequest class not ASIHTTPRequest.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload