top of page
LTServer

//LTServer.h

//0. DETERMINE WHAT WOULD YOU LIKE TO TRACK IN THE 'LOG CONSOLE'.

typedef NS_ENUM(NSUInteger, LTServerLog) {

    LTServerLogALL, //DEFAULT. (logs all).

    LTServerLogRequest,

    LTServerLogResponse,

    LTServerLogNon,

};

@interface LTServer : NSObject

 

 

#pragma mark - setters: (setup)

//1. @optional (recommended: if you are using YOUR SERVER BASE PATH: (www.path.com)

+ (void)setServerBase:(NSString *)_server_base;

+ (void)setToken:(NSString*)token;

+ (void)setTokenKey:(NSString*)token_key;

+ (void)setLogType:(LTServerLog)log_type;

+ (void)setTimeOut:(NSTimeInterval)timeOut;

 

 

#pragma mark ------------------------------------------------------- POST:

//POST (ATTACH OPTIONAL: NSDictionary to server.(value key, value key..).

+(id)postUrl:(NSString*)url;

+(id)postUrl:(NSString*)url attach:(id)JSONObject;

+(id)postBase_url:(NSString*)Base_url;

+(id)postBase_url:(NSString*)Base_url attach:(id)JSONObject;

 

#pragma mark ------------------------------------------------------- GET:

+ (id)getUrl:(NSString*)url;

+ (id)getUrl:(NSString*)url attach:(NSDictionary*)dictionary;

+ (id)getBase_url:(NSString*)url;

+ (id)getBase_url:(NSString*)base_url attach:(NSDictionary*)dictionary;

 

 

 

#pragma mark ------------------------------------------------------------------------------------------------------------- UI:

+(void)showNetworkIndicatior;

+(void)hideNetworkIndicatior;

 

 

#pragma mark - service

+ (id)sendRequest:(NSMutableURLRequest*)request;

+ (NSMutableString*)createParam:(NSDictionary*)dictionary;

+ (NSMutableDictionary *)recursiveNullRemove:(NSMutableDictionary *)dictionaryResponse;

@end

bottom of page