Skip to content

Commit

Permalink
Added header values dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Josip Bernat committed Oct 24, 2014
1 parent e6bcb0e commit 3c2b4df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions JBMessage/JBMessage/JBMessage+NSURLConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ - (AFHTTPRequestOperationManager *)requestOperationManager {
[manager.requestSerializer setValue:self.authorizationToken forHTTPHeaderField:@"Token"];
}

[self.headerValues enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[manager.requestSerializer setValue:obj forHTTPHeaderField:key];
}];

if (self.username && self.username.length &&
self.password && self.password.length) {

Expand Down
5 changes: 5 additions & 0 deletions JBMessage/JBMessage/JBMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ typedef void (^JBDownloadBlock)(NSUInteger bytesRead, long long totalBytesRead,
*/
@property (nonatomic, strong) NSString *authorizationToken;

/**
* Header values for request. Default is nil.
*/
@property (nonatomic, strong) NSDictionary *headerValues;

/**
* Basic authorization username.
*/
Expand Down

0 comments on commit 3c2b4df

Please sign in to comment.