GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: An iPhoto plugin to export photos to Gallery.
Homepage: http://zwily.com/iphoto
Clone URL: git://github.com/zwily/iphototogallery.git
iphototogallery / Source / ZWMutableURLRequest.h
100644 42 lines (32 sloc) 1.253 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
//
// ZWMutableURLRequest.h
// iPhotoToGallery
//
// Created by Zach Wily on 7/1/05.
// Copyright 2005 __MyCompanyName__. All rights reserved.
//
// This class extended NSMutableURLRequest by letting you actually set the POST parameters as well.
// (It build the data content section). I tried doing it with a clever category on NSMutableURLRequest
// but that ended up being more work than it was worth.
//
// The cool thing about it is that you can specify URL Encoded or Multipart MIME encoding.
//
 
#import <Cocoa/Cocoa.h>
 
typedef enum {
    ZSURLEncodedVariation,
    ZSURLMultipartVariation
} ZWURLRequestPOSTVariation;
 
@interface ZWMutableURLRequest : NSMutableURLRequest {
    NSData *boundaryData;
    NSMutableData *requestBodyData;
    NSStringEncoding encoding;
    
    ZWURLRequestPOSTVariation variation;
}
 
- (CFHTTPMessageRef)copyCFHTTPMessageRef;
 
- (void)setVariation:(ZWURLRequestPOSTVariation)newVariation;
- (ZWURLRequestPOSTVariation)variation;
 
- (void)setEncoding:(NSStringEncoding)newEncoding;
- (NSStringEncoding)encoding;
 
- (void)addString:(NSString *)string forName:(NSString *)name;
- (void)addData:(NSData *)data forName:(NSString *)name filename:(NSString *)filename contentType:(NSString *)contentType;
 
@end