This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MMHTTPClient.h
54 lines (47 loc) · 2.52 KB
/
MMHTTPClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// MMHTTPClient.h
// Marshmallows
//
// Created by Sami Samhuri on 11-09-03.
// Copyright 2011 Guru Logic. 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 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;
@end