Note that there are some explanatory texts on larger screens.

plurals
  1. PONSURLConnection not sending querystring
    primarykey
    data
    text
    <p><strong>Update:</strong> Thanks to Rob, I've discovered the server is also not seeing querystring parameters when simply typing the address into iOS Safari (Chrome Mac OS, however, works fine). So it appears it may be something strange on the server side after all.</p> <hr> <p>I'm having a strange issue where the following code is not sending the querystring section of the request. If I log <code>$_SERVER['QUERY_STRING']</code> on the server side, it is blank. However if I simply type the url into a browser, the server correctly logs it.</p> <p>Also strangely <code>NSURL</code> picks up the query string fine if I log <code>[nsurl query]</code>, so the problem appears to be with either <code>NSURLConnection</code> or <code>NSURLRequest</code>.</p> <pre><code>NSString* queryString = [self.appDelegate.connections componentsJoinedByString:@"|"]; NSString* url = [NSString stringWithFormat:@"http://mysite.com/?%@&amp;isajax=1", queryString]; NSLog(@"url: %@", url); // http://mysite.com/?test&amp;isajax=1 NSURL* nsurl = [NSURL URLWithString:url]; NSLog(@"nsurl: %@", [nsurl query]); // test&amp;isajax=1 NSURLRequest *request = [NSURLRequest requestWithURL:nsurl]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^( NSURLResponse* response, NSData* responseData, NSError* error ) { // returns the page as if no query string were present at all }]; </code></pre> <p>I'm wondering if it has to do with the lack of a filename. Maybe <code>NSURLConnection</code> doesn't like that. <strong>Edit:</strong> Nope, nothing to do with that. Tried <code>/index.php?test&amp;isajax=1</code> and still no good.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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