diff --git a/ASIHTTPRequest.podspec b/ASIHTTPRequest.podspec new file mode 100644 index 00000000..5fc86d8c --- /dev/null +++ b/ASIHTTPRequest.podspec @@ -0,0 +1,45 @@ +Pod::Spec.new do |s| + s.name = 'ASIHTTPRequest' + s.version = '1.8.2' + s.summary = 'Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone.' + s.homepage = 'http://allseeing-i.com/ASIHTTPRequest' + s.author = { 'Ben Copsey' => 'ben@allseeing-i.com' } + s.license = 'New BSD License' + s.source = { :git => 'https://github.com/hhuai/asi-http-request.git', :tag => s.version } + + s.description = %{ + ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that + makes some of the more tedious aspects of communicating with web servers + easier. It is written in Objective-C and works in both Mac OS X and iPhone + applications. + + It is suitable performing basic HTTP requests and interacting with + REST-based services (GET / POST / PUT / DELETE). The included + ASIFormDataRequest subclass makes it easy to submit POST data and files + using multipart/form-data. + } + + s.source_files = 'Classes' + + s.ios.dependency 'Reachability' #, '~> 2.0', '>= 2.0.4' + s.ios.frameworks = 'MobileCoreServices', 'CFNetwork', 'CoreGraphics' + + s.osx.exclude_files = '**/*ASIAuthenticationDialog*' + s.osx.frameworks = 'SystemConfiguration', 'CoreServices' + + s.library = 'z.1' + + s.subspec 'ASIWebPageRequest' do |ws| + ws.source_files = 'Classes/ASIWebPageRequest/' + ws.library = 'xml2.2' + ws.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' } + end + + s.subspec 'CloudFiles' do |cfs| + cfs.source_files = 'Classes/CloudFiles/' + end + + s.subspec 'S3' do |s3s| + s3s.source_files = 'Classes/S3/' + end +end diff --git a/Classes/ASIFormDataRequest.m b/Classes/ASIFormDataRequest.m index 2d812a04..8a59c8a0 100644 --- a/Classes/ASIFormDataRequest.m +++ b/Classes/ASIFormDataRequest.m @@ -219,16 +219,14 @@ - (void)buildMultipartFormDataPostBody #if DEBUG_FORM_DATA_REQUEST [self addToDebugBody:@"\r\n==== Building a multipart/form-data body ====\r\n"]; #endif - - NSString *charset = (NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding([self stringEncoding])); - + // We don't bother to check if post data contains the boundary, since it's pretty unlikely that it does. CFUUIDRef uuid = CFUUIDCreate(nil); NSString *uuidString = [(NSString*)CFUUIDCreateString(nil, uuid) autorelease]; CFRelease(uuid); NSString *stringBoundary = [NSString stringWithFormat:@"0xKhTmLbOuNdArY-%@",uuidString]; - [self addRequestHeader:@"Content-Type" value:[NSString stringWithFormat:@"multipart/form-data; charset=%@; boundary=%@", charset, stringBoundary]]; + [self addRequestHeader:@"Content-Type" value:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", stringBoundary]]; [self appendPostString:[NSString stringWithFormat:@"--%@\r\n",stringBoundary]];