Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
These constants are used by Sync iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Farache committed May 8, 2014
1 parent 54eb796 commit 9810ea0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ios/Source/Http/LRHttpUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

extern NSString *const LR_ERROR_DOMAIN;
extern NSString *const LR_GET;
extern NSString *const LR_HEAD;
extern NSString *const LR_IF_MODIFIED_SINCE;
extern NSString *const LR_LAST_MODIFIED;
extern NSString *const LR_POST;
extern const int LR_STATUS_OK;
extern const int LR_STATUS_UNAUTHORIZED;
extern const int LR_UNKNOWN_VERSION;
Expand Down
9 changes: 4 additions & 5 deletions ios/Source/Http/LRHttpUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@

NSString *const LR_ERROR_DOMAIN = @"com.liferay.mobile";
NSString *const LR_GET = @"GET";
NSString *const LR_HEAD = @"HEAD";
NSString *const LR_IF_MODIFIED_SINCE = @"If-Modified-Since";
NSString *const LR_LAST_MODIFIED = @"Last-Modified";
NSString *const LR_POST = @"POST";
const int LR_STATUS_OK = 200;
const int LR_STATUS_UNAUTHORIZED = 401;
const int LR_UNKNOWN_VERSION = -1;
const int LR_VERSION_6_2 = 6200;

static NSString *const _HEAD = @"HEAD";
static NSString *const _POST = @"POST";

/**
* @author Bruno Farache
*/
Expand Down Expand Up @@ -53,7 +52,7 @@ + (int)getPortalVersionWithURL:(NSString *)URL error:(NSError **)error {
NSMutableURLRequest *request =
[[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:URL]];

[request setHTTPMethod:_HEAD];
[request setHTTPMethod:LR_HEAD];

NSHTTPURLResponse *response;

Expand Down Expand Up @@ -152,7 +151,7 @@ + (NSMutableURLRequest *)_getRequest:(LRSession *)session
NSData *body = [NSJSONSerialization dataWithJSONObject:commands options:0
error:error];

[request setHTTPMethod:_POST];
[request setHTTPMethod:LR_POST];
[request setTimeoutInterval:session.connectionTimeout];
[request setValue:authHeader forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json; charset=utf-8"
Expand Down

0 comments on commit 9810ea0

Please sign in to comment.