GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - flambert/SVHTTPRequest: Straightforward GET and POST requests for your iOS app.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
Demo
Demo
 
 
SVHTTPRequest
SVHTTPRequest
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.textile
README.textile
 
 

Repository files navigation

SVHTTPRequest

SVHTTPRequest is a simple and extremely straightforward alternative to bulky ASIHTTPRequest. It is blocked-based, uses NSURLConnection and its only 3rd party dependancy is the blazing fast JSONKit (included in package).

SVHTTPRequest features:

  • straightforward singleton convenience methods
  • completion block handler
  • response is automatically parsed (if applicable) and forwarded to completion block
  • support for basic authentication request signing
  • talks with setNetworkActivityIndicatorVisible

Installation

  • Drag the SVHTTPRequest/SVHTTPRequest folder into your project.

Usage

(see sample Xcode project in /Demo)

SVHTTPRequest was designed to be the most straightforward possible:

[SVHTTPRequest GET:@"http://api.twitter.com/1/users/show.json"
        parameters:[NSDictionary dictionaryWithObject:@"samvermette" forKey:@"screen_name"]
        completion:^(NSObject *response) {
            NSLog(@"%@", response);
        }];

By now you’ve probably guessed how to make a POST request.

Cancelling requests

Make sure you cancel requests for which the user isn’t waiting on anymore:

SVHTTPRequest *request = [SVHTTPRequest GET:@"http://api.twitter.com/1/users/show.json"
                                 parameters:[NSDictionary dictionaryWithObject:@"samvermette" forKey:@"screen_name"]
                                 completion:^(NSObject *response) {
                                     NSLog(@"%@", response);
                                 }];
   
[request cancel];

Connection errors

Requests that fail will report back to the completion block with a nil response object. You can also use the response object to detect errors, depending on the type of call you’re making (for instance you were expecting a JSON object and it’s not, or if the server itself is providing you with error descriptions).

Signing requests for basic auth

You can easily sign your requests for basic authentication using similar convenience methods:

[SVHTTPRequest POST:address
         parameters:parameters 
           username:username
           password:password
         completion:completionBlock];

Credits

SVHTTPRequest is brought to you by Sam Vermette (@samvermette) and contributors to the project. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues. If you’re using SVHTTPRequest in your project, attribution would be nice.

About

Straightforward GET and POST requests for your iOS app.

samvermette.com/297

Resources

Readme
License
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.