-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathHTTPConnection.h
More file actions
47 lines (38 loc) · 1.65 KB
/
HTTPConnection.h
File metadata and controls
47 lines (38 loc) · 1.65 KB
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
#import <Foundation/Foundation.h>
@class HTTPServer;
@interface HTTPConnection : NSObject
@property(readwrite, assign) int status;
@property(readwrite, strong) NSString *reason;
@property(readwrite, unsafe_unretained) HTTPServer *server;
@property(readonly, strong) NSDictionary *requestMultipartSegments;
@property(readonly, strong, nonatomic) NSData *requestBodyData;
@property(readonly, strong) NSString *requestBody, *httpAuthUser;
@property(readonly, strong) NSData *queryString;
@property(readonly, strong) NSURL *url;
@property(readonly) long requestLength, remoteIp, remotePort;
@property(readonly) BOOL requestIsMultipart, isOpen, isSSL, isStreaming;
@property(readwrite) BOOL shouldWriteHeaders;
// Sends a file (with appropriate headers) and closes the connection
- (void)serveFileAtPath:(NSString *)aPath;
- (NSInteger)writeData:(NSData *)aData;
- (NSInteger)writeString:(NSString *)aString;
- (NSInteger)writeFormat:(NSString *)aFormat, ...;
// A streaming connection simply flushes after each write
- (void)makeStreaming;
- (NSInteger)flushData;
- (NSString *)getCookie:(NSString *)aName;
- (void)setCookie:(NSString *)aName
to:(NSString *)aValue
withAttributes:(NSDictionary *)aAttrs;
- (void)setCookie:(NSString *)aName
to:(NSString *)aValue;
- (void)setCookie:(NSString *)aName
to:(NSString *)aValue
expires:(NSDate *)aExpiryDate;
- (NSString *)requestBodyVar:(NSString *)aName;
- (NSString *)requestQueryVar:(NSString *)aName;
- (NSDictionary *)allRequestHeaders;
- (NSString *)requestHeader:(NSString *)aName;
- (void)setResponseHeader:(NSString *)aHeader to:(NSString *)aValue;
- (void)close;
@end