FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSURLRequest.h
Go to the documentation of this file.
1 //
2 // NSURLRequest.h
3 // FoundationExtension
4 //
5 // Created by Jeong YunWon on 10. 10. 17..
6 // Copyright 2010 youknowone.org All rights reserved.
7 //
8 
20 
21 @property(readonly) NSURL *URL;
22 @property(readonly) NSURLRequestCachePolicy cachePolicy;
23 @property(readonly) NSTimeInterval timeoutInterval;
24 #if TARGET_OS_IPHONE
25 @property(readonly) NSURLRequestNetworkServiceType networkServiceType;
26 #endif
27 @property(readonly) NSURL *mainDocumentURL;
28 
29 @property(readonly) NSDictionary *allHTTPHeaderFields;
30 @property(readonly) NSString *HTTPMethod;
31 @property(readonly) NSData *HTTPBody;
32 #if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED || __IPHONE_2_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
33 @property(readonly) NSInputStream *HTTPBodyStream;
34 #endif
35 @property(readonly) BOOL HTTPShouldHandleCookies;
36 @property(readonly) BOOL HTTPShouldUsePipelining;
37 
38 @end
39 
45 
47 - (id)initWithURLFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
49 - (id)initWithFilePath:(NSString *)filePath __deprecated;
51 - (id)initWithFilePathFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
53 - (id)initWithAbstractPath:(NSString *)filePath __deprecated;
55 - (id)initWithAbstractPathFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
56 
58 + (id)URLRequestWithURLFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
60 + (id)URLRequestWithFilePath:(NSString *)filepath __deprecated;
62 + (id)URLRequestWithFilePathFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
64 + (id)URLRequestWithAbstractPath:(NSString *)filePath __deprecated;
66 + (id)URLRequestWithAbstractPathFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2) __deprecated;
67 
68 @end
69 
74 
75 @property(retain) NSURL *URL;
76 @property NSURLRequestCachePolicy cachePolicy;
77 @property NSTimeInterval timeoutInterval;
78 #if TARGET_OS_IPHONE
79 @property NSURLRequestNetworkServiceType networkServiceType;
80 #endif
81 @property(retain) NSURL *mainDocumentURL;
82 
83 @property(retain) NSDictionary *allHTTPHeaderFields;
84 @property(retain) NSString *HTTPMethod;
85 @property(retain) NSData *HTTPBody;
86 #if MAC_OS_X_VERSION_10_4 <= MAC_OS_X_VERSION_MAX_ALLOWED || __IPHONE_2_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
87 @property(retain) NSInputStream *HTTPBodyStream;
88 #endif
89 @property BOOL HTTPShouldHandleCookies;
90 @property BOOL HTTPShouldUsePipelining;
91 
92 @end
93 
98 
105 - (void)setHTTPPostBody:(NSDictionary *)bodyDictionary;
106 
114 - (void)setHTTPPostBody:(NSDictionary *)bodyDictionary encoding:(NSStringEncoding)encoding
115 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101100 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
116 NS_DEPRECATED(10_0, 10_11, 2_0, 9_0, "Use -setHTTPPostBody: instead, which always uses the recommended UTF-8 encoding.")
117 #endif
118 ;
119 
120 @end
121 
122 
127  NSMutableData *_body;
128  NSStringEncoding _encoding;
129 }
130 
135 - (instancetype)initWithEncoding:(NSStringEncoding)encoding;
141 - (void)appendBodyDataToFieldName:(NSString *)fieldName text:(NSString *)textData;
148 - (void)appendBodyDataToFieldName:(NSString *)fieldName text:(NSString *)textData encoding:(NSStringEncoding)encoding;
154 - (void)appendBodyDataToFieldName:(NSString *)fieldName data:(NSData *)data;
161 - (void)appendBodyDataToFieldName:(NSString *)fieldName fileName:(NSString *)fileName data:(NSData *)data;
162 
167 - (void)appendBodyDataEndian;
168 
174 - (NSData *)HTTPBody;
175 
176 @end
177 
183 
194 - (void)setHTTPMultiPartFormPostBody:(NSDictionary *)bodyDictionary encoding:(NSStringEncoding)encoding;
195 
196 @end
NSTimeInterval timeoutInterval
Definition: NSURLRequest.h:23
NSURLRequestCachePolicy cachePolicy
Definition: NSURLRequest.h:76
NSMutableURLRequest POST extension.
Definition: NSURLRequest.h:97
NSString * HTTPMethod
Definition: NSURLRequest.h:30
NSInputStream * HTTPBodyStream
Definition: NSURLRequest.h:33
NSData * HTTPBody
Definition: NSURLRequest.h:31
NSURLRequest Multipart Form POST extension.
Definition: NSURLRequest.h:182
BOOL HTTPShouldHandleCookies
Definition: NSURLRequest.h:35
Multipart Form POST data formatter for NSMutableURLRequest.
Definition: NSURLRequest.h:126
NSStringEncoding _encoding
Definition: NSURLRequest.h:128
BOOL HTTPShouldUsePipelining
Definition: NSURLRequest.h:36
NSURLRequest property shortcuts for legacy compilers.
Definition: NSURLRequest.h:19
NSMutableData * _body
Definition: NSURLRequest.h:127
NSURL * URL
Definition: NSURLRequest.h:21
BOOL HTTPShouldHandleCookies
Definition: NSURLRequest.h:89
NSTimeInterval timeoutInterval
Definition: NSURLRequest.h:77
BOOL HTTPShouldUsePipelining
Definition: NSURLRequest.h:90
Deprecated creation shortcuts.
Definition: NSURLRequest.h:44
NSURL * mainDocumentURL
Definition: NSURLRequest.h:27
NSURLRequest property shortcuts for legacy compilers.
Definition: NSURLRequest.h:73
NSURLRequestCachePolicy cachePolicy
Definition: NSURLRequest.h:22
NSDictionary * allHTTPHeaderFields
Definition: NSURLRequest.h:29