Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

55 lines (47 sloc) 2.587 kb
//
// MMHTTPClient.h
// Marshmallows
//
// Created by Sami Samhuri on 11-09-03.
// Copyright 2011 Sami Samhuri. All rights reserved.
//
#import <UIKit/UIImage.h>
#import "MMHTTPRequest.h"
@interface MMHTTPClient : NSObject
{
NSString *_baseURL;
NSUInteger _timeout;
}
+ (MMHTTPClient *) sharedClient;
+ (id) client;
+ (id) clientWithBaseURL: (NSString *)baseURL;
+ (id) clientWithBaseURL: (NSString *)baseURL timeout: (NSUInteger)timeout;
+ (NSString *) pathFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
+ (NSString *) urlFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
+ (NSString *) urlWithPath: (NSString *)path;
+ (MMHTTPRequest *) request: (NSDictionary *)options then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) get: (NSString *)url then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) getImage: (NSString *)url then: (MMHTTPImageCallback)callback;
+ (MMHTTPRequest *) getText: (NSString *)url then: (MMHTTPTextCallback)callback;
+ (MMHTTPRequest *) post: (NSString *)url then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) post: (NSString *)url fields: (NSDictionary *)fields then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) post: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) put: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
+ (MMHTTPRequest *) delete: (NSString *)url then: (MMHTTPCallback)callback;
@property (nonatomic, retain) NSString *baseURL;
@property NSUInteger timeout;
- (id) initWithBaseURL: (NSString *)baseURl;
- (id) initWithBaseURL: (NSString *)baseURl timeout: (NSUInteger)timeout;
- (NSString *) pathFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
- (NSString *) urlFor: (NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
- (NSString *) urlWithPath: (NSString *)path;
- (MMHTTPRequest *) request: (NSDictionary *)options then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) get: (NSString *)url then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) getImage: (NSString *)url then: (MMHTTPImageCallback)callback;
- (MMHTTPRequest *) getText: (NSString *)url then: (MMHTTPTextCallback)callback;
- (MMHTTPRequest *) post: (NSString *)url fields: (NSDictionary *)fields then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) post: (NSString *)url then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) post: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) put: (NSString *)url data: (NSData *)data then: (MMHTTPCallback)callback;
- (MMHTTPRequest *) delete: (NSString *)url then: (MMHTTPCallback)callback;
@end
Jump to Line
Something went wrong with that request. Please try again.