-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathNSMutableURLRequest+Posts.h
More file actions
27 lines (20 loc) · 1.05 KB
/
NSMutableURLRequest+Posts.h
File metadata and controls
27 lines (20 loc) · 1.05 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
//
// NSMutableURLRequest+Posts.h
//
// Created by Jiva DeVoe on 3/20/10.
// Copyright 2010 Random Ideas, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
/** Various utilities for working with NSMutableURLRequests.
*/
@interface NSMutableURLRequest (Posts)
/// Creates an NSMutableURLRequest with headers specifying that the body contains XML and with a body containing the passed XML.
+(id)postRequestForURL:(NSURL *)inURL withXml:(NSString *)inXml;
/// Creates an NSMutableURLRequest with headers specifying that the body contains JSON and with a body containing the passed JSON.
+(id)postRequestForURL:(NSURL *)inURL withJSON:(NSString *)inJSON;
+(id)postRequestForURL:(NSURL *)inURL params:(NSDictionary *)inDictionary;
+(id)putRequestForURL:(NSURL *)inURL params:(NSDictionary *)inDictionary;
+(id)requestWithURL:(NSURL *)inURL params:(NSDictionary *)inDictionary;
/// Adds headers to the request for basic authentication using the given parameters.
-(void)addAuthenticationForUsername:(NSString *)inUsername password:(NSString *)inPassword;
@end