//
// ASIHTTPRequest.h
//
// Created by Ben Copsey on 04/10/2007.
// Copyright 2007-2010 All-Seeing Interactive. All rights reserved.
//
// A guide to the main features is available at:
// http://allseeing-i.com/ASIHTTPRequest
//
// Portions are based on the ImageClient example from Apple:
// See: http://developer.apple.com/samplecode/ImageClient/listing37.html
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <CFNetwork/CFNetwork.h>
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_0
#import <UIKit/UIKit.h> // Necessary for background task support
#endif
#endif
#import <stdio.h>
#import "ASIHTTPRequestConfig.h"
#import "ASIHTTPRequestDelegate.h"
#import "ASIProgressDelegate.h"
#import "ASICacheDelegate.h"
@class ASIDataDecompressor;
extern NSString *ASIHTTPRequestVersion;
// Make targeting different platforms more reliable
// See: http://www.blumtnwerx.com/blog/2009/06/cross-sdk-code-hygiene-in-xcode/
#ifndef __IPHONE_3_2
#define __IPHONE_3_2 30200
#endif
#ifndef __IPHONE_4_0
#define __IPHONE_4_0 40000
#endif
#ifndef __MAC_10_5
#define __MAC_10_5 1050
#endif
#ifndef __MAC_10_6
#define __MAC_10_6 1060
#endif
typedef enum _ASIAuthenticationState {
ASINoAuthenticationNeededYet = 0,
ASIHTTPAuthenticationNeeded = 1,
ASIProxyAuthenticationNeeded = 2
} ASIAuthenticationState;
typedef enum _ASINetworkErrorType {
ASIConnectionFailureErrorType = 1,
ASIRequestTimedOutErrorType = 2,
ASIAuthenticationErrorType = 3,
ASIRequestCancelledErrorType = 4,
ASIUnableToCreateRequestErrorType = 5,
ASIInternalErrorWhileBuildingRequestType = 6,
ASIInternalErrorWhileApplyingCredentialsType = 7,
ASIFileManagementError = 8,
ASITooMuchRedirectionErrorType = 9,
ASIUnhandledExceptionError = 10,
ASICompressionError = 11
} ASINetworkErrorType;
// The error domain that all errors generated by ASIHTTPRequest use
extern NSString* const NetworkRequestErrorDomain;
// You can use this number to throttle upload and download bandwidth in iPhone OS apps send or receive a large amount of data
// This may help apps that might otherwise be rejected for inclusion into the app store for using excessive bandwidth
// This number is not official, as far as I know there is no officially documented bandwidth limit
extern unsigned long const ASIWWANBandwidthThrottleAmount;
#if NS_BLOCKS_AVAILABLE
typedef void (^ASIBasicBlock)(void);
typedef void (^ASIHeadersBlock)(NSDictionary *responseHeaders);
typedef void (^ASISizeBlock)(long long size);
typedef void (^ASIProgressBlock)(unsigned long long size, unsigned long long total);
typedef void (^ASIDataBlock)(NSData *data);
#endif
@interface ASIHTTPRequest : NSOperation <NSCopying> {
// The url for this operation, should include GET params in the query string where appropriate
NSURL *url;
// Will always contain the original url used for making the request (the value of url can change when a request is redirected)
NSURL *originalURL;
// Temporarily stores the url we are about to redirect to. Will be nil again when we do redirect
NSURL *redirectURL;
// The delegate, you need to manage setting and talking to your delegate in your subclasses
id <ASIHTTPRequestDelegate> delegate;
// Another delegate that is also notified of request status changes and progress updates
// Generally, you won't use this directly, but ASINetworkQueue sets itself as the queue so it can proxy updates to its own delegates
// NOTE: WILL BE RETAINED BY THE REQUEST
id <ASIHTTPRequestDelegate, ASIProgressDelegate> queue;
// HTTP method to use (GET / POST / PUT / DELETE / HEAD). Defaults to GET
NSString *requestMethod;
// Request body - only used when the whole body is stored in memory (shouldStreamPostDataFromDisk is false)
NSMutableData *postBody;
// gzipped request body used when shouldCompressRequestBody is YES
NSData *compressedPostBody;
// When true, post body will be streamed from a file on disk, rather than loaded into memory at once (useful for large uploads)
// Automatically set to true in ASIFormDataRequests when using setFile:forKey:
BOOL shouldStreamPostDataFromDisk;
// Path to file used to store post body (when shouldStreamPostDataFromDisk is true)
// You can set this yourself - useful if you want to PUT a file from local disk
NSString *postBodyFilePath;
// Path to a temporary file used to store a deflated post body (when shouldCompressPostBody is YES)
NSString *compressedPostBodyFilePath;
// Set to true when ASIHTTPRequest automatically created a temporary file containing the request body (when true, the file at postBodyFilePath will be deleted at the end of the request)
BOOL didCreateTemporaryPostDataFile;
// Used when writing to the post body when shouldStreamPostDataFromDisk is true (via appendPostData: or appendPostDataFromFile:)
NSOutputStream *postBodyWriteStream;
// Used for reading from the post body when sending the request
NSInputStream *postBodyReadStream;
// Dictionary for custom HTTP request headers
NSMutableDictionary *requestHeaders;
// Set to YES when the request header dictionary has been populated, used to prevent this happening more than once
BOOL haveBuiltRequestHeaders;
// Will be populated with HTTP response headers from the server
NSDictionary *responseHeaders;
// Can be used to manually insert cookie headers to a request, but it's more likely that sessionCookies will do this for you
NSMutableArray *requestCookies;
// Will be populated with cookies
NSArray *responseCookies;
// If use useCookiePersistence is true, network requests will present valid cookies from previous requests
BOOL useCookiePersistence;
// If useKeychainPersistence is true, network requests will attempt to read credentials from the keychain, and will save them in the keychain when they are successfully presented
BOOL useKeychainPersistence;
// If useSessionPersistence is true, network requests will save credentials and reuse for the duration of the session (until clearSession is called)
BOOL useSessionPersistence;
// If allowCompressedResponse is true, requests will inform the server they can accept compressed data, and will automatically decompress gzipped responses. Default is true.
BOOL allowCompressedResponse;
// If shouldCompressRequestBody is true, the request body will be gzipped. Default is false.
// You will probably need to enable this feature on your webserver to make this work. Tested with apache only.
BOOL shouldCompressRequestBody;
// When downloadDestinationPath is set, the result of this request will be downloaded to the file at this location
// If downloadDestinationPath is not set, download data will be stored in memory
NSString *downloadDestinationPath;
// The location that files will be downloaded to. Once a download is complete, files will be decompressed (if necessary) and moved to downloadDestinationPath
NSString *temporaryFileDownloadPath;
// If the response is gzipped and shouldWaitToInflateCompressedResponses is NO, a file will be created at this path containing the inflated response as it comes in
NSString *temporaryUncompressedDataDownloadPath;
// Used for writing data to a file when downloadDestinationPath is set
NSOutputStream *fileDownloadOutputStream;
NSOutputStream *inflatedFileDownloadOutputStream;
// When the request fails or completes successfully, complete will be true
BOOL complete;
// external "finished" indicator, subject of KVO notifications; updates after 'complete'
BOOL finished;
// True if our 'cancel' selector has been called
BOOL cancelled;
// If an error occurs, error will contain an NSError
// If error code is = ASIConnectionFailureErrorType (1, Connection failure occurred) - inspect [[error userInfo] objectForKey:NSUnderlyingErrorKey] for more information
NSError *error;
// Username and password used for authentication
NSString *username;
NSString *password;
// Domain used for NTLM authentication
N
没有合适的资源?快使用搜索试试~ 我知道了~
IOS应用源码之网络操作 .rar
共216个文件
sample:24个
h:20个
svn-base:20个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 30 浏览量
2022-07-09
15:35:37
上传
评论
收藏 451KB RAR 举报
温馨提示
IOS应用源码之网络操作 .rar
资源推荐
资源详情
资源评论
收起资源包目录
IOS应用源码之网络操作 .rar (216个子文件)
0596476e261969848598d674e3ddcaf703c5a6 154B
0ce082d6aa75bfdfa26638b0389371f2c1a149 1KB
10b50bb77d00e4ef866fc26b94579db19f1ae0 57B
178e4d5666a3b75aa48de33b966f0590665a8e 1KB
20ac738a703f48d9227d98fb0abfb2d8192cc3 2KB
210e458c874e0bd9ce7ad93ecd92b4e6592532 81B
2a634eb19e50241c3567dbb7da3565451fa6eb 176B
32f9e818720be75218bf5b619f3b99e8917ad9 1KB
3455119b43196994279cebe70c807b9110d739 87B
3de1d58acf1b9c3e7e341ca71425fb07077882 294B
4590edd11368d9084646fc346e1662e0da1360 82B
56f8395ef91d5b6901421c775e286193977c06 227B
5aae35325b50c845afddbd90ad81209f592b8d 323B
5d85cd9b346c3e40643e0f5a9ba26642eab0f0 254B
5f90a4e33f0aa815ad3530303c3f6c9e70f1ab 232B
62a6a802897ddcfbbe24078954ccae909246c4 1KB
7796d2d02f13848a7b8302d5ae3f3736594733 261B
782f9fad79e1472069d58b27327d6672eb4a7c 3KB
7982fb403cb5b33792d8947eebb1a2851a043c 2KB
7b28ff8f86a3158a71c4934fbd3a2456717d7a 61B
7b28ff8f86a3158a71c4934fbd3a2456717d7a 61B
7b28ff8f86a3158a71c4934fbd3a2456717d7a 61B
825b5a6306c3cfad1d35bba008d64123ba2914 2KB
825b5a6306c3cfad1d35bba008d64123ba2914 2KB
8ca6f693f96d511e9113c0eb59eec552354e42 2KB
8ca6f693f96d511e9113c0eb59eec552354e42 2KB
8d4a057ee189179a5de6340ded6f0933c6571b 382B
8f7428eee9e7b4264adcf45838f7fb4a3a462b 385B
91b7aabfcf3422423b109c8beed2bab838c607 2KB
91b7aabfcf3422423b109c8beed2bab838c607 2KB
97d4b8584fca5fb030040067130e8be9e40792 482B
97d4b8584fca5fb030040067130e8be9e40792 482B
a36c92d9ff6b8c19ba39644aa1fa7d0987cdf8 189B
all-wcprops 3KB
b2ca564635e2f919ead6f0f28e25c110a01a7c 58B
b556481723da9ae1555241ed9ffa7b2f498927 265B
b84cffeb4db607983c8383fa9199731dc3aba0 2KB
b84cffeb4db607983c8383fa9199731dc3aba0 2KB
bd33bce3882f7f282236dae5187da143d1daac 323B
c0b3a0a8522755e61090d6a7d478af6dc4469e 103B
c0b3a0a8522755e61090d6a7d478af6dc4469e 103B
c89216c9a1457bd3bd05085c9702129371d4ea 228B
cdcf4e38525f81ad0c8f77875904e44a9720e2 3KB
ce25474475b33564e0541ef28fb238d1a1b231 3KB
cffb3ee02736eae2d0c22f6395f8a3b7c38a4a 272B
COMMIT_EDITMSG 15B
COMMIT_EDITMSG 15B
COMMIT_EDITMSG 15B
config 111B
config 111B
config 111B
d4224d81fdfe8221da0a1635b79758db8b8ef9 57B
description 73B
description 73B
description 73B
df355727e786c4bc8340fa87458f0eedc825d3 254B
.DS_Store 12KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
e083eb563718f4d726c126bb7f389ab8198c39 154B
e4aa16839a30fb1e3a824ab9a23cb55a2ac671 176B
e4d1173913dfe674ce5340926106e1e25accf2 141B
e96952c28445649dec63f8cafad906503fa5b1 107B
ea2048cd88c2d50475595842fe58f4e063daff 265B
entries 3KB
exclude 35B
exclude 35B
exclude 35B
f2e35535af27a7c547a2eb773acaaed06b6307 487B
f3588e61c59bd920948b13d6b23b4b7f460971 381B
ASIHTTPRequest.h 42KB
ASINetworkQueue.h 5KB
ASICacheDelegate.h 4KB
Reachability.h 4KB
Reachability.h 4KB
ASIFormDataRequest.h 3KB
ASIDownloadCache.h 2KB
ASIDataCompressor.h 2KB
ASIDataDecompressor.h 2KB
ASIProgressDelegate.h 2KB
ASIHTTPRequestDelegate.h 2KB
ASIAuthenticationDialog.h 1KB
ASIInputStream.h 969B
ASIHTTPRequestConfig.h 944B
ViewController.h 534B
ViewController.h 426B
ViewController.h 420B
AppDelegate.h 375B
AppDelegate.h 364B
AppDelegate.h 364B
HEAD 181B
HEAD 181B
HEAD 178B
HEAD 23B
HEAD 23B
共 216 条
- 1
- 2
- 3
资源评论
reg183
- 粉丝: 1817
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功