Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (39 sloc) 1.911 kb


Provides a class to handle complex (although not much) NSURLConnection delegate routing and provides two, quick to implement, delegate methods with success or failure report, along with concerned connection data (response status code, response data, NSURLRequest instance)

Also check out to pair this up with!


  • An apple computer


  • Kick it!
    /* Prepare a NSURLRequest (or GSFormDataRequest) instance here */

// Now. GSHTTPRequest *HTTPRequest = [[GSHTTPRequest alloc] initWithURLRequest:request delegate:self]; // Yes, it's not released here. [HTTPRequest startURLConnection];

  • Handle delegate methods
     - (void)requestSucceeded:(NSDictionary *)theResponse HTTPRequest:(id)HTTPRequest {
    // Handle success.
    [HTTPRequest release];
 - (void)requestFailed:(NSDictionary *)response HTTPRequest:(id)HTTPRequest {
  // Handle failure.
  [HTTPRequest release];

The response NSDictionary argument contains three objects, "responseStatusCode", "responseString" and "request". Maybe response shouldn't parse the data into NSString (as "responseString"). Trivial change, if you need it.


Find me on Twitter: Or use the form at to talk privately wink


Copyright (c) 2010 Gurpartap Singh,

This code is licensed under the MIT License

You are free:

  • to Share — to copy, distribute and transmit the work
  • to Remix — to adapt the work

Under the following conditions:

  • The copyright notice and license shall be included in all copies or substantial portions of the software.
  • Any of the above conditions can be waived if you get permission from the copyright holder.

See bundled MIT-LICENSE.txt file for detailed license terms.

Jump to Line
Something went wrong with that request. Please try again.