diff options
Diffstat (limited to 'src/common/mac/HTTPMultipartUpload.h')
-rw-r--r-- | src/common/mac/HTTPMultipartUpload.h | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/common/mac/HTTPMultipartUpload.h b/src/common/mac/HTTPMultipartUpload.h index 42e8fed3..5eaaa91b 100644 --- a/src/common/mac/HTTPMultipartUpload.h +++ b/src/common/mac/HTTPMultipartUpload.h @@ -27,35 +27,39 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// HTTPMultipartUpload: A multipart/form-data HTTP uploader. -// Each parameter pair is sent as a boundary -// Each file is sent with a name field in addition to the filename and data -// The data will be sent synchronously. + #import <Foundation/Foundation.h> -@interface HTTPMultipartUpload : NSObject { +#import "HTTPRequest.h" + /** + Represents a multipart/form-data HTTP upload (POST request). + Each parameter pair is sent as a boundary. + Each file is sent with a name field in addition to the filename and data. + */ +@interface HTTPMultipartUpload : HTTPRequest { @protected - NSURL *url_; // The destination URL (STRONG) NSDictionary *parameters_; // The key/value pairs for sending data (STRONG) NSMutableDictionary *files_; // Dictionary of name/file-path (STRONG) NSString *boundary_; // The boundary string (STRONG) - NSHTTPURLResponse *response_; // The response from the send (STRONG) } -- (id)initWithURL:(NSURL *)url; - -- (NSURL *)URL; - +/** + Sets the parameters that will be sent in the multipart POST request. + */ - (void)setParameters:(NSDictionary *)parameters; - (NSDictionary *)parameters; +/** + Adds a file to be uploaded in the multipart POST request, by its file path. + */ - (void)addFileAtPath:(NSString *)path name:(NSString *)name; + +/** + Adds a file to be uploaded in the multipart POST request, by its name and + contents. + */ - (void)addFileContents:(NSData *)data name:(NSString *)name; - (NSDictionary *)files; -// Set the data and return the response -- (NSData *)send:(NSError **)error; -- (NSHTTPURLResponse *)response; - @end |