Skip to content
Browse files

Added property to switch HTTP version.

Signed-off-by: Ben Copsey <ben@allseeing-i.com>
  • Loading branch information...
1 parent 531cbd5 commit 47cd9b576876375a90d05096d5c17a0735ed05b8 Basil Shkara committed with
Showing with 4 additions and 1 deletion.
  1. +2 −0 Classes/ASIHTTPRequest.h
  2. +2 −1 Classes/ASIHTTPRequest.m
View
2 Classes/ASIHTTPRequest.h
@@ -212,6 +212,7 @@ typedef enum _ASINetworkErrorType {
// Custom user information assosiated with the request
NSDictionary *userInfo;
+ BOOL HTTPVersionOne;
}
@@ -395,5 +396,6 @@ typedef enum _ASINetworkErrorType {
@property (retain) NSInputStream *postBodyReadStream;
@property (assign) BOOL shouldStreamPostDataFromDisk;
@property (assign) BOOL didCreateTemporaryPostDataFile;
+@property (assign) BOOL HTTPVersionOne;
@end
View
3 Classes/ASIHTTPRequest.m
@@ -301,7 +301,7 @@ - (void)main
}
// Create a new HTTP request.
- request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)requestMethod, (CFURLRef)url, kCFHTTPVersion1_1);
+ request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)requestMethod, (CFURLRef)url, self.HTTPVersionOne ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1);
if (!request) {
[self failWithError:ASIUnableToCreateRequestError];
return;
@@ -1625,4 +1625,5 @@ + (int)uncompressZippedDataFromSource:(FILE *)source toDestination:(FILE *)dest
@synthesize postBodyReadStream;
@synthesize shouldStreamPostDataFromDisk;
@synthesize didCreateTemporaryPostDataFile;
+@synthesize HTTPVersionOne;
@end

0 comments on commit 47cd9b5

Please sign in to comment.
Something went wrong with that request. Please try again.