Skip to content

Commit

Permalink
Merge pull request #9 from vishalduggal/NATIVESDK-156
Browse files Browse the repository at this point in the history
Good job on this @vishalduggal. The unit tests you provided made this easy to test - thank you.
  • Loading branch information
matt-langston committed Jun 14, 2014
2 parents 9c1b002 + 92aa050 commit 76550a2
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 178 deletions.
28 changes: 25 additions & 3 deletions APSHTTPClient/APSHTTPRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef NS_ENUM(NSInteger, APSRequestError) {
-(void)request:(APSHTTPRequest*)request onError:(APSHTTPResponse*)response;
-(void)request:(APSHTTPRequest*)request onDataStream:(APSHTTPResponse*)response;
-(void)request:(APSHTTPRequest*)request onSendStream:(APSHTTPResponse*)response;
-(void)request:(APSHTTPRequest*)request onReadyStateChage:(APSHTTPResponse*)response;
-(void)request:(APSHTTPRequest*)request onReadyStateChange:(APSHTTPResponse*)response;
-(void)request:(APSHTTPRequest*)request onRedirect:(APSHTTPResponse*)response;

@end
Expand All @@ -46,12 +46,34 @@ typedef NS_ENUM(NSInteger, APSRequestError) {
@property(nonatomic, assign, readwrite) NSTimeInterval timeout;
@property(nonatomic, assign, readwrite) BOOL sendDefaultCookies;
@property(nonatomic, assign, readwrite) BOOL redirects;
@property(nonatomic, assign, readwrite) BOOL synchronous;
@property(nonatomic, assign, readwrite) BOOL validatesSecureCertificate;
@property(nonatomic, assign, readwrite) BOOL cancelled;
@property(nonatomic, strong, readwrite) NSOperationQueue *theQueue;
@property(nonatomic, assign, readwrite) NSURLRequestCachePolicy cachePolicy;

/*!
@discussion Set to YES to block the caller's thread for the duration
of the network call. In this case the queue property is ignored. The
default value is NO.
*/
@property(nonatomic, assign, readwrite) BOOL synchronous;

/*!
@discussion An optional NSOperationQueue for delegate callbacks.
The default value is nil, which means delegate callbakcs occur on
the caller's thread if the synchronous property is NO. If the
synchronous property is YES then this property is ignored.
*/
@property(nonatomic, strong, readwrite) NSOperationQueue *theQueue;

/*!
@discussion An optioanl array of run loop modes for delegate calllbacks
on the run loop of the caller's thread. The default is one element
array containing NSDefaultRunLoopMode. This is an advanced property,
and is ignored if synchronous is YES or theQueue is not nil. It is
the caller's responsibility to keep the thread and the run loop alive.
*/
@property(nonatomic, strong, readwrite) NSArray *runModes;

// Only used in Titanium ImageLoader
@property(nonatomic, strong, readwrite) NSDictionary *userInfo;

Expand Down

0 comments on commit 76550a2

Please sign in to comment.